]> granicus.if.org Git - curl/commitdiff
multi_socket: set timeout for 100-continue
authorDaniel Stenberg <daniel@haxx.se>
Fri, 6 Aug 2010 08:57:44 +0000 (10:57 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 6 Aug 2010 09:00:17 +0000 (11:00 +0200)
When libcurl internally decided to wait for a 100-continue header, there
was no call to the timeout function so there was no timeout callback
called when the multi_socket API was used and thus applications became
either completely wrong or at least ineffecient depending on how they
handled the situation. We now set a timeout to get triggered.

Reported by: Ben Darnell
Bug: http://curl.haxx.se/bug/view.cgi?id=3039744

lib/transfer.c

index 41bf2fe110503fe39f6bdcefa14a7afb5e70baa9..99a62610bd5e1c17a0e8f48889cb4dc446f6e1c2 100644 (file)
@@ -811,6 +811,9 @@ static CURLcode readwrite_upload(struct SessionHandle *data,
           k->keepon &= ~KEEP_SEND;         /* disable writing */
           k->start100 = Curl_tvnow();       /* timeout count starts now */
           *didwhat &= ~KEEP_SEND;  /* we didn't write anything actually */
+
+          /* set a timeout for the multi interface */
+          Curl_expire(data, CURL_TIMEOUT_EXPECT_100);
           break;
         }
 
@@ -2265,6 +2268,9 @@ Curl_setup_transfer(
         /* wait with write until we either got 100-continue or a timeout */
         k->exp100 = EXP100_AWAITING_CONTINUE;
         k->start100 = k->start;
+
+        /* set a timeout for the multi interface */
+        Curl_expire(data, CURL_TIMEOUT_EXPECT_100);
       }
       else {
         if(data->state.expect100header)