[wp-trac] [WordPress Trac] #33055: Support Parallel HTTP Requests in WP_Http, et al

WordPress Trac noreply at wordpress.org
Tue May 31 22:36:59 UTC 2016


#33055: Support Parallel HTTP Requests in WP_Http, et al
----------------------------+--------------------------
 Reporter:  wonderboymusic  |       Owner:  rmccue
     Type:  task (blessed)  |      Status:  assigned
 Priority:  high            |   Milestone:  4.6
Component:  HTTP API        |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  needs-patch     |     Focuses:  performance
----------------------------+--------------------------

Comment (by Otto42):

 Replying to [comment:43 rmccue]:
 > This definitely sounds like a misuse of the HTTP API; if you're
 specifying a 10ms timeout, then you should get that. Expecting it to round
 up to a second is using undefined behaviour. Let's fix it in the other
 tickets though. :)

 I agree, however if you're specifying anything less than half a second,
 this code would make your timeout get set to zero:

 https://core.trac.wordpress.org/browser/trunk/src/wp-
 includes/Requests/Transport/cURL.php?rev=37428#L351

 {{{
 curl_setopt($this->handle, CURLOPT_TIMEOUT_MS, round($options['timeout'] *
 1000));
 }}}

 Same for line 358.

 Having a case where somebody specifies a low timeout and then having it
 interpret that in a way which causes the entire library to do nothing but
 twiddle its thumbs seems like a bad idea.

 Also, the curl documentation says that the minimum timeout allowed is 1
 second.

 https://curl.haxx.se/libcurl/c/CURLOPT_TIMEOUT_MS.html

 > If libcurl is built to use the standard system name resolver, that
 portion of the transfer will still use full-second resolution for timeouts
 with a minimum timeout allowed of one second.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33055#comment:46>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list