diff options
author | Daniel Stenberg <daniel@haxx.se> | 2013-08-27 22:32:51 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2013-08-28 00:07:12 +0200 |
commit | a691e044705f12715fcd3310a9832dd5de79bff0 (patch) | |
tree | b28f8575c2cdc608f84399454246c78a49eb1247 /lib/transfer.c | |
parent | 3d1a453d887a6272f48c241af6190d17891aef02 (diff) | |
download | curl-a691e044705f12715fcd3310a9832dd5de79bff0.tar.gz |
multi_socket: improved 100-continue timeout handling
When waiting for a 100-continue response from the server, the
Curl_readwrite() will refuse to run if called until the timeout has been
reached.
We timeout code in multi_socket() allows code to run slightly before the
actual timeout time, so for test 154 it could lead to the function being
executed but refused in Curl_readwrite() and then the application would
just sit idling forever.
This was detected with runtests.pl -e on test 154.
Diffstat (limited to 'lib/transfer.c')
-rw-r--r-- | lib/transfer.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/transfer.c b/lib/transfer.c index 31553eb46..760e79d9f 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -1952,8 +1952,10 @@ Curl_setup_transfer( k->exp100 = EXP100_AWAITING_CONTINUE; k->start100 = Curl_tvnow(); - /* set a timeout for the multi interface */ - Curl_expire(data, CURL_TIMEOUT_EXPECT_100); + /* Set a timeout for the multi interface. Add the inaccuracy margin so + that we don't fire slightly too early and get denied to run. */ + Curl_expire(data, CURL_TIMEOUT_EXPECT_100 + + MULTI_TIMEOUT_INACCURACY / 1000); } else { if(data->state.expect100header) |