commit | 3e8d86dcc0487826047e98fb88ca7f59232dec3e | [log] [tgz] |
---|---|---|
author | Roger Leigh <rleigh@apache.org> | Sat Sep 08 10:42:56 2018 +0000 |
committer | Roger Leigh <rleigh@apache.org> | Sat Sep 08 10:42:56 2018 +0000 |
tree | 857b37b4a5d852b6fef0ecfa81125a9d3ea03be0 | |
parent | 4a5f4ea8e0e1abb83c467b0309ea48340a92db66 [diff] |
CurlURLInputStream: remove fixed timeout Fixes https://issues.apache.org/jira/browse/XERCESC-2147 using the patch from https://issues.shibboleth.net/jira/browse/CPPXT-132 git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@1840352 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp b/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp index 5f8a4af..8d9befd 100644 --- a/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp +++ b/src/xercesc/util/NetAccessors/Curl/CurlURLInputStream.cpp
@@ -333,8 +333,14 @@ // Wait on the file descriptors timeval tv; - tv.tv_sec = 2; - tv.tv_usec = 0; + + long multi_timeout = 0; + curl_multi_timeout(fMulti, &multi_timeout); + if (multi_timeout < 0) + multi_timeout = 1000; + + tv.tv_sec = multi_timeout / 1000; + tv.tv_usec = (multi_timeout % 1000) * 1000; select(fdcnt+1, &readSet, &writeSet, &exceptSet, &tv); }