cURL Mailing List Monthly Index Single Mail
And speaking of data sending bugs...
From: Nick Zitzmann <nick_at_chronosnet.com>
Date: Mon, 11 Feb 2013 15:00:35 -0700
While I was testing the patch I made over the weekend for the curl_darwinssl transmission bug, I found a related issue that I suspect affects all builds of 7.29.0: If a program creates a curl_easy handle, sets CURLOPT_TIMEOUT to some value greater than 0 but less than the amount of time it takes to transfer a file, and then issues an HTTP command that sends data to the server (e.g. PUT, POST, PROPFIND, REPORT, extended MKCOL, etc.), then after the amount of seconds entered in CURLOPT_TIMEOUT elapses and the transfer is not done yet, libcurl reports "Operation timed out after X milliseconds with 0 out of -1 bytes received" where X is the timeout value in milliseconds.
Steps to reproduce:
1. Create a curl_easy handle
One would expect the file to be uploaded to the URL, but instead libcurl (not the server) times out before all data is transferred and aborts the transfer, returning the error message "Operation timed out after 60000 milliseconds with 0 out of -1 bytes received". The problem does not happen if timeout is set to an arbitrary really large number.
Looking into this a little deeper, it appears that the handle's state changes from CURLM_STATE_DO after the headers are sent to CURLM_STATE_PERFORM. Once the user is authenticated and the server replies with HTTP/1.1 100 Continue, libcurl starts sending the file data, but it doesn't look like there's any other state change at this point. Perhaps the solution here is to break CURLM_STATE_PERFORM into send and receive states, not time out during the send state, and change from send to receive after sending is done? I don't know if I'd break something if I did this myself, so I'm wondering if an expert could look into this…
These mail archives are generated by hypermail.
Page updated January 05, 2012.
web site info