Skip to content

Commit

Permalink
Add a check for when a read() returns zero.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebrady committed Oct 31, 2024
1 parent 1488bf0 commit aa3af3b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rtsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit aa3af3b

Please sign in to comment.