mirror of
https://github.com/morgan9e/UxPlay
synced 2026-04-14 00:04:13 +09:00
raop_rtp_mirror.c fix detection of ECONNRESET
This commit is contained in:
@@ -43,6 +43,7 @@ struct raop_callbacks_s {
|
||||
void (*conn_teardown)(void *cls, bool *teardown_96, bool *teardown_110 );
|
||||
void (*audio_flush)(void *cls);
|
||||
void (*video_flush)(void *cls);
|
||||
void (*video_conn_reset) (void *cls);
|
||||
void (*audio_set_volume)(void *cls, float volume);
|
||||
void (*audio_set_metadata)(void *cls, const void *buffer, int buflen);
|
||||
void (*audio_set_coverart)(void *cls, const void *buffer, int buflen);
|
||||
|
||||
@@ -293,7 +293,7 @@ raop_rtp_mirror_thread(void *arg)
|
||||
} else if (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 recv: %d", errno);
|
||||
if (errno == ECONNRESET) conn_reset = true;;
|
||||
if (errno == ECONNRESET) conn_reset = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -442,12 +442,11 @@ raop_rtp_mirror_thread(void *arg)
|
||||
raop_rtp_mirror->running = false;
|
||||
MUTEX_UNLOCK(raop_rtp_mirror->run_mutex);
|
||||
|
||||
|
||||
logger_log(raop_rtp_mirror->logger, LOGGER_DEBUG, "raop_rtp_mirror exiting TCP thread");
|
||||
if (conn_reset && raop_rtp_mirror->callbacks.video_conn_reset) {
|
||||
logger_log(raop_rtp_mirror->logger, LOGGER_DEBUG, "raop_rtp_mirror: connection reset by client");
|
||||
logger_log(raop_rtp_mirror->logger, LOGGER_DEBUG, "raop_rtp_mirror: received ECONNRESET from socket");
|
||||
raop_rtp_mirror->callbacks.video_conn_reset(raop_rtp_mirror->callbacks.cls);
|
||||
}
|
||||
logger_log(raop_rtp_mirror->logger, LOGGER_DEBUG, "raop_rtp_mirror exiting TCP thread");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user