]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
rtsp: check EOS in the RTSP receive and return an error code
authorDeng Jianfeng <dengjfzh@gmail.com>
Fri, 22 Nov 2024 08:59:19 +0000 (16:59 +0800)
committerViktor Szakats <commit@vsz.me>
Mon, 25 Nov 2024 17:36:41 +0000 (18:36 +0100)
This helps the caller detect disconnection events.

Fixes #15624
Closes #15626

lib/rtsp.c

index 0bd6ad6281e949722176723e97a3a4ca25adf080..ecefd132d2c598569418c4ac366341fef7544ad0 100644 (file)
@@ -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;