]> granicus.if.org Git - curl/commitdiff
rtsp: stop reading empty DESCRIBE responses
authorErik Janssen <erik.janssen@axis.com>
Thu, 20 Aug 2015 21:07:03 +0000 (23:07 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 20 Aug 2015 21:07:03 +0000 (23:07 +0200)
Based-on-patch-by: Jim Hollinger
lib/http.c

index 9817d72af8301efa3ce25d1b4ccd0e87b9aa8531..d7b56c30b5982d10b30066413fed3a70ee901f33 100644 (file)
@@ -3185,6 +3185,16 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
          */
         if(data->set.opt_no_body)
           *stop_reading = TRUE;
+#ifndef CURL_DISABLE_RTSP
+        else if((conn->handler->protocol & CURLPROTO_RTSP) &&
+                (data->set.rtspreq == RTSPREQ_DESCRIBE) &&
+                (k->size <= -1))
+          /* Respect section 4.4 of rfc2326: If the Content-Length header is
+             absent, a length 0 must be assumed.  It will prevent libcurl from
+             hanging on DECRIBE request that got refused for whatever
+             reason */
+          *stop_reading = TRUE;
+#endif
         else {
           /* If we know the expected size of this document, we set the
              maximum download size to the size of the expected