#11468 closed defect (bug) (fixed)
Most HTTP transport methods in WP_Http process floats as integers for their respective timeout options.
Reported by: | mdawaffe | Owned by: | dd32 |
---|---|---|---|
Milestone: | 2.9 | Priority: | normal |
Severity: | major | Version: | 2.9 |
Component: | HTTP API | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
- WP_Http_Curl
- http://us2.php.net/curl_setopt
Problem: CURLOPT_TIMEOUT, CURLOPT_CONNECTTIMEOUT.
Fix: Use CURLOPT_TIMEOUT_MS, CURLOPT_CONNECTTIMEOUT_MS instead when possible.
- All stream based methods (WP_Http_Fsockopen, WP_Http_Fopen, WP_Http_Streams)
- http://us2.php.net/manual/en/function.stream-set-timeout.php
Problem: stream_set_timeout( $handle, $timeout );
Fix: use stream_set_timeout( $handle, $timeout, $utimeout );
fsockopen() does accept a (float) timeout argument, but WP_Http_Fsockopen also calls stream_set_timeout().
- WP_Http_ExtHTTP
- http://us2.php.net/manual/en/http.request.options.php
Problem: timeout, connecttimeout.
Fix: None.
Attached patches all affected WP_Http transports to send timeouts as ceil()'d integers to their underlying PHP functions. ceil() is used to prevent sending a timeout of 0.
Setting as Severity:major since this prevents spawn_cron() (which sets a timeout of 0.01) from spawning anything if the WP_Http_ExtHTTP transport is used.
Setting as Milestone:2.9. Bump as needed.
Looks pretty sane to me..