]> git.kaiwu.me - klib.git/commit
Fixed slow sftp/scp connection
authorHeng Li <lh3@me.com>
Mon, 18 Nov 2013 20:29:18 +0000 (15:29 -0500)
committerHeng Li <lh3@me.com>
Mon, 18 Nov 2013 20:29:18 +0000 (15:29 -0500)
commit81a72689fec1d6cf7b05ec98a60bf8995df5f50d
tree1c2ead4f0ea6e23c4b2b8a95d653b7c8894c9cd6
parent23a2169c853a444e23c9b7c7133fa354801433c1
Fixed slow sftp/scp connection

In curl/docs/examples/fopen.c, the developer didn't check maxfd set by
curl_multi_fdset() and supposed that calling select(0,...) is effectively
equivalent to sleep. While the comment is correct, timeout estimated by
curl_multi_fdset() is frequently too large - in my case 10 seconds. We seldom
need to wait that long.

In curl_multi_fdset.3, the cURL developers recommended to wait at least 100ms
if maxfd is set to 1. This is what I am doing in the revised code. It does
little harm.
kurl.c