From e243e733632d76eae2cd2eced35fe95411e0a68f Mon Sep 17 00:00:00 2001 From: Deng Jianfeng Date: Fri, 22 Nov 2024 16:59:19 +0800 Subject: [PATCH] rtsp: check EOS in the RTSP receive and return an error code This helps the caller detect disconnection events. Fixes #15624 Closes #15626 --- lib/rtsp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/rtsp.c b/lib/rtsp.c index 0bd6ad6281..ecefd132d2 100644 --- a/lib/rtsp.c +++ b/lib/rtsp.c @@ -213,6 +213,11 @@ static CURLcode rtsp_done(struct Curl_easy *data, (data->conn->proto.rtspc.rtp_channel == -1)) { infof(data, "Got an RTP Receive with a CSeq of %ld", CSeq_recv); } + if(data->set.rtspreq == RTSPREQ_RECEIVE && + data->req.eos_written) { + failf(data, "Server prematurely closed the RTSP connection."); + return CURLE_RECV_ERROR; + } } return httpStatus; -- 2.47.3