From f373fb2edcfb1f4c279e5796cf21e4a865800a71 Mon Sep 17 00:00:00 2001 From: fduncanh Date: Sat, 23 Apr 2022 15:32:18 -0400 Subject: [PATCH] revert commit 5efcf01 of March 12, 2020 This breaks reconnection after "stop streaming" is sent by client. It was intended to aid reconnection if a network interruption left a socket blocked. Some other fix for that issue will be needed. This is connected to issue #58 --- lib/raop_rtp_mirror.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/raop_rtp_mirror.c b/lib/raop_rtp_mirror.c index 7a3b3238..ffeb80eb 100644 --- a/lib/raop_rtp_mirror.c +++ b/lib/raop_rtp_mirror.c @@ -180,7 +180,6 @@ 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; unsigned char nal_start_code[4] = { 0x00, 0x00, 0x00, 0x01 }; #ifdef DUMP_H264 @@ -274,15 +273,10 @@ raop_rtp_mirror_thread(void *arg) } if (payload == NULL && ret == 0) { - 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; - } + 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)); @@ -290,8 +284,6 @@ raop_rtp_mirror_thread(void *arg) break; } - conn_started = true; - /*packet[0:3] contains the payload size */ int payload_size = byteutils_get_int(packet, 0);