]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
don't try the rewind if no http struct is allocated yet
authorDaniel Stenberg <daniel@haxx.se>
Fri, 10 Dec 2004 14:45:35 +0000 (14:45 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 10 Dec 2004 14:45:35 +0000 (14:45 +0000)
lib/http.c

index 8303c5301022d9341af88ca506ee34feb58fba2a..d984eddc1d60977a89cd8749074dfd1288735839 100644 (file)
@@ -219,9 +219,16 @@ static CURLcode perhapsrewind(struct connectdata *conn)
 {
   struct HTTP *http = conn->proto.http;
   struct SessionHandle *data = conn->data;
-  curl_off_t bytessent = http->writebytecount;
+  curl_off_t bytessent;
   curl_off_t expectsend = -1; /* default is unknown */
 
+  if(!http)
+    /* If this is still NULL, we have not reach very far and we can
+       safely skip this rewinding stuff */
+    return CURLE_OK;
+
+  bytessent = http->writebytecount;
+
   /* figure out how much data we are expected to send */
   switch(data->set.httpreq) {
   case HTTPREQ_POST: