]> granicus.if.org Git - curl/commitdiff
retry request: only access the HTTP data if in fact HTTP
authorDaniel Stenberg <daniel@haxx.se>
Tue, 7 Aug 2012 12:55:19 +0000 (14:55 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 7 Aug 2012 12:55:19 +0000 (14:55 +0200)
When figuring out if the data stream needs to be rewound when the
request is to be resent, we must not access the HTTP struct unless the
protocol used is indeed HTTP...

Bug: http://curl.haxx.se/bug/view.cgi?id=3544688

lib/transfer.c

index d6fc934459de6e6c7e61b597964381c36d659e9c..73456ec3e71114e8b7fc58b5bb3acb1f1156c71b 100644 (file)
@@ -2060,7 +2060,9 @@ CURLcode Curl_retry_request(struct connectdata *conn,
                                 error just because nothing has been
                                 transferred! */
 
-    if(data->state.proto.http->writebytecount)
+
+    if((conn->handler->protocol&CURLPROTO_HTTP) &&
+       data->state.proto.http->writebytecount)
       return Curl_readrewind(conn);
   }
   return CURLE_OK;