From 551734b398e63f83b1e2235546f88f360d476666 Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Mon, 13 Feb 2023 08:34:55 +0000 Subject: [PATCH] Treat a keepalive timeout the same as if the client had closed the connection. Total timeout is 35 + 5 * 5 = 60(?) seconds. --- rtsp.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rtsp.c b/rtsp.c index 9bf28a80..ed67c581 100644 --- a/rtsp.c +++ b/rtsp.c @@ -1385,6 +1385,12 @@ enum rtsp_read_request_response rtsp_read_request(rtsp_conn_info *conn, rtsp_mes conn->connection_number); continue; } + if (errno == ETIMEDOUT) { + debug(1, "Connection %d: ETIMEDOUT -- keepalive timeout.", conn->connection_number); + reply = rtsp_read_request_response_channel_closed; + // Note: the socket will be closed when the thread exits + goto shutdown; + } if (errno != ECONNRESET) { char errorstring[1024]; strerror_r(errno, (char *)errorstring, sizeof(errorstring));