]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
rtsp: don't let CSeq error override earlier errors
authorJay Satiro <raysatiro@yahoo.com>
Mon, 28 Feb 2022 19:28:37 +0000 (14:28 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Fri, 18 Mar 2022 07:24:37 +0000 (03:24 -0400)
- When done, if an error has already occurred then don't check the
  sequence numbers for mismatch.

A sequence number may not have been received if an error occurred.

Prior to this change a sequence mismatch error would override earlier
errors. For example, a server that returns nothing would cause error
CURLE_GOT_NOTHING in Curl_http_done which was then overridden by
CURLE_RTSP_CSEQ_ERROR in rtsp_done.

Closes https://github.com/curl/curl/pull/8525

lib/rtsp.c

index f16e87c12d3107fdc3a82daae6de29c6c161a6c0..726bfb9ae1a3fb4fda73402de86b87185a7e3de5 100644 (file)
@@ -219,7 +219,7 @@ static CURLcode rtsp_done(struct Curl_easy *data,
 
   httpStatus = Curl_http_done(data, status, premature);
 
-  if(rtsp) {
+  if(rtsp && !status && !httpStatus) {
     /* Check the sequence numbers */
     long CSeq_sent = rtsp->CSeq_sent;
     long CSeq_recv = rtsp->CSeq_recv;