From: Deng Jianfeng Date: Fri, 22 Nov 2024 08:59:19 +0000 (+0800) Subject: rtsp: check EOS in the RTSP receive and return an error code X-Git-Tag: curl-8_11_1~51 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e243e733632d76eae2cd2eced35fe95411e0a68f;p=thirdparty%2Fcurl.git rtsp: check EOS in the RTSP receive and return an error code This helps the caller detect disconnection events. Fixes #15624 Closes #15626 --- 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;