php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44553 curl_multi does not processing multiple cURL handles in parallel with SOCKS5
Submitted: 2008-03-27 16:17 UTC Modified: 2008-03-29 06:48 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:2 (66.7%)
From: administrator at gesoft dot org Assigned:
Status: Closed Package: cURL related
PHP Version: 5.2.5 OS: FreeBSD 6.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: administrator at gesoft dot org
New email:
PHP Version: OS:

 

 [2008-03-27 16:17 UTC] administrator at gesoft dot org
Description:
------------
curl_multi does not processing multiple cURL handles in parallel when SOCKS type proxies are used. This could be easily determined by checking the spent time or by using any NET software to check amount of opened connections for particular process (you will see that curl_multi opens one or max two connections at a time)

Reproduce code:
---------------
  $mh = curl_multi_init();
  foreach ($servers as $server) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'http://google.com');
    curl_setopt($ch, CURLOPT_TIMEOUT, 5);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_ENCODING, '');
    curl_setopt($ch, CURLOPT_PROXY, trim($server));
    curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);  
    curl_multi_add_handle($mh, $ch);
  }

  $microTime = GetMicroTime();
  do {
    do {
    } while (curl_multi_exec($mh, $stillRunning) === CURLM_CALL_MULTI_PERFORM);
  } while ($stillRunning);  
  $timeSpend = GetMicroTime() - $microTime;

  echo sprintf('%01.4f', $timeSpend);

Expected result:
----------------
The maximum spent time should be ~5 sec.

Actual result:
--------------
While the actual value vary from 20 till 35 sec. 

p.s. If you will use simple HTTP type proxies the result will be as expected ~5 sec.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-29 06:48 UTC] administrator at gesoft dot org
Daniel Stenberg <daniel_at_haxx.se> wrote:

"This is a known libcurl bug mentioned in docs/KNOWN_BUGS:"
http://curl.haxx.se/docs/knownbugs.html

"35. Both SOCKS5 and SOCKS4 proxy connections are done blocking, which is very bad when used with the multi interface."
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 13:01:29 2024 UTC