From aa3af3b368ffef08db35f4b7ffc15a89a74c35e8 Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Thu, 31 Oct 2024 17:28:12 +0000 Subject: [PATCH] Add a check for when a read() returns zero. --- rtsp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rtsp.c b/rtsp.c index 1712e4805..e76189958 100644 --- a/rtsp.c +++ b/rtsp.c @@ -1179,9 +1179,13 @@ ssize_t timed_read_from_rtsp_connection(rtsp_conn_info *conn, uint64_t wait_time read_encrypted(conn->fd, &conn->ap2_pairing_context.control_cipher_bundle, buf, count); } else { result = read(conn->fd, buf, count); + if (result == 0) + debug(1, "AP2 read result 0, for a request count of %u.", count); } #else result = read(conn->fd, buf, count); + if (result == 0) + debug(1, "AP1 read result 0, for a request count of %u.", count); #endif if (wait_time != 0) remaining_time = time_to_wait_to - get_absolute_time_in_ns();