mirror of
https://github.com/morgan9e/UxPlay
synced 2026-04-14 00:04:13 +09:00
fix historic bug whene socket closes
This commit is contained in:
@@ -177,6 +177,7 @@ raop_rtp_mirror_thread(void *arg)
|
||||
bool conn_reset = false;
|
||||
uint64_t ntp_timestamp_nal = 0;
|
||||
uint64_t ntp_timestamp_raw = 0;
|
||||
bool conn_started = false;
|
||||
|
||||
#ifdef DUMP_H264
|
||||
// C decrypted
|
||||
@@ -269,10 +270,15 @@ raop_rtp_mirror_thread(void *arg)
|
||||
}
|
||||
|
||||
if (payload == NULL && ret == 0) {
|
||||
logger_log(raop_rtp_mirror->logger, LOGGER_ERR, "raop_rtp_mirror tcp socket is closed, got %d bytes of 128 byte header",readstart);
|
||||
FD_CLR(stream_fd, &rfds);
|
||||
stream_fd = -1;
|
||||
continue;
|
||||
if (conn_started) {
|
||||
logger_log(raop_rtp_mirror->logger, LOGGER_ERR, "raop_rtp_mirror tcp socket is closed, connection ended");
|
||||
break;
|
||||
} else {
|
||||
logger_log(raop_rtp_mirror->logger, LOGGER_ERR, "raop_rtp_mirror tcp socket is closed, got %d bytes of 128 byte header",readstart);
|
||||
FD_CLR(stream_fd, &rfds);
|
||||
stream_fd = -1;
|
||||
continue;
|
||||
}
|
||||
} else if (payload == NULL && ret == -1) {
|
||||
if (errno == EAGAIN || errno == EWOULDBLOCK) continue; // Timeouts can happen even if the connection is fine
|
||||
logger_log(raop_rtp_mirror->logger, LOGGER_ERR, "raop_rtp_mirror error in header recv: %d %s", errno, strerror(errno));
|
||||
@@ -280,6 +286,7 @@ raop_rtp_mirror_thread(void *arg)
|
||||
break;
|
||||
}
|
||||
|
||||
conn_started = true;
|
||||
int payload_size = byteutils_get_int(packet, 0);
|
||||
//unsigned short payload_type = byteutils_get_short(packet, 4) & 0xff;
|
||||
//unsigned short payload_option = byteutils_get_short(packet, 6);
|
||||
|
||||
Reference in New Issue
Block a user