Problem occurs when using libcurl to attempt to connect to a non-existent TFTP server, with CURLOPT_CONNECTTIMEOUT < CURLOPT_TIMEOUT.
libcurl version libcurl/7.33.0
CURLOPT_URL=tftp://192.168.0.3/somefile (server doesn't exist)
When calling curl_easy_perform:
< 10 seconds later... >
curl_easy_perform returned CURLE_OPERATION_TIMEDOUT after 20 seconds.
What happens after the 10 second timeout is that tftp_multi_statemach returns CURLE_OPERATION_TIMEDOUT to tftp_doing each time it is called, but tftp_doing overwrites the result with the result from Curl_speedcheck, which returns OK.
Forcing tftp_doing to return the CURLE_OPERATION_TIMEDOUT produces the correct result, which is that curl_easy_perform returns CURLE_OPERATION_TIMEDOUT after 10 seconds. I don't know if this is the correct approach.
May be related to http://sourceforge.net/p/curl/bugs/856/ which is a similar bug with FTP.