From 8e31a9c8566ea3e24d51584bd8f8d7c4554d681b Mon Sep 17 00:00:00 2001
From: Jim Hollinger <hollinger.jim@gmail.com>
Date: Tue, 31 May 2011 12:46:48 -0400
Subject: [PATCH 2/2] Curl_http_readwrite_headers: Added RTSP conditional check for 401 or 407 unauthorized error to stop reading (i.e. don't expect a body in the response to an RTSP DESCRIBE request in the event of an unauthorized error).

---
 lib/http.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/lib/http.c b/lib/http.c
index 1e463ee..34f5325 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -2854,6 +2854,14 @@ CURLcode Curl_http_readwrite_headers(struct SessionHandle *data,
          */
         if(data->set.opt_no_body)
           *stop_reading = TRUE;
+#ifndef CURL_DISABLE_RTSP
+        /* If we get an unauthorized error during an RTSP DESCRIBE request,
+           then don't expect a body */
+        else if((conn->handler->protocol & CURLPROTO_RTSP) &&
+                (data->set.rtspreq == RTSPREQ_DESCRIBE) &&
+                ((k->httpcode == 401) || (k->httpcode == 407)))
+          *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
-- 
1.7.4.msysgit.0

