5

I'm trying to use PHP cURL HTTP Pipelining feature to perform multiple requests through single TCP connection. Refers to this page http://www.php.net/manual/en/function.curl-multi-setopt.php I'm enabling pipleining for curl_multi_exec() by adding:

curl_multi_setopt($mh, CURLMOPT_PIPELINING, 1);

I don't want to post a big source listing here, but you can easily view or checkout the full example from my github here https://github.com/anovikov1984/pipelining-example

For monitoring TCP connections I use 'netstat -t -u -c' command in another console session.

In my repo that I mentioned above there are two scripts. One for Ruby and one for PHP. The Ruby version works as wanted and opens only single TCP connection for 3 GET requests. But the PHP cURL version opens as many TCP connection as the number of cURL handles passed to curl_multi_exec() function.

What am i doing wrong?

1 Answers1

2

It looks like this may be a bug in PHP's implementation of curl_multi_* with PIPELINING. It appears they may not expose all the CONSTANTS necessary to enable a developer to dictate how curl behaves on a multi-request when using PIPELINING.

I've submitted the bug report here: https://bugs.php.net/bug.php?id=68449

datashovel
  • 152
  • 13
  • When you submit a bug report to a bug tracking system, the report should specify what the problem is, rather than just relying on a link to a discussion on another website for the problem description. Especially, the title of the bug report should be specific, and not just a generic term. – thomasrutter Aug 04 '15 at 06:15
  • I do apologize. I thought the "Package" option was relevant. Notice how the Package option was marked "cURL related". Above the link there is a short description. I do apologize if that was not clear. If someone was actually handling the bug, and felt the bug was unclear, wouldn't they usually open a thread with me on that ticket to get additional information instead of taking that conversation to Stack Overflow? Feel free to update the bug ticket to reflect a more appropriate description so I can learn how to do it for future reference. – datashovel Aug 05 '15 at 06:52
  • My comment was just as an observer, I have nothing to do with the Php or Curl projects so I don't feel any hard feelings. Just intended as a tip on how you might get more attention on your bug reports. – thomasrutter Aug 06 '15 at 07:29