Skip to content

Commit

Permalink
Don't use CURLOPT_CONNECTTIMEOUT_MS or CURLOPT_TIMEOUT_MS due to bugg…
Browse files Browse the repository at this point in the history
…iness. fixes #11505 see #11499 for 2.9

git-svn-id: https://develop.svn.wordpress.org/branches/2.9@12473 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
ryanboren committed Dec 21, 2009
1 parent dba85f3 commit 6f24b87
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions wp-includes/http.php
Expand Up @@ -1296,16 +1296,9 @@ function request($url, $args = array()) {

// CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT expect integers. Have to use ceil since
// a value of 0 will allow an ulimited timeout.
// Use _MS if available.
if ( defined( 'CURLOPT_TIMEOUT_MS' ) ) {
$timeout_ms = (int) ceil( 1000 * $r['timeout'] );
curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT_MS, $timeout_ms );
curl_setopt( $handle, CURLOPT_TIMEOUT_MS, $timeout_ms );
} else {
$timeout = (int) ceil( $r['timeout'] );
curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $timeout );
curl_setopt( $handle, CURLOPT_TIMEOUT, $timeout );
}
$timeout = (int) ceil( $r['timeout'] );
curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $timeout );
curl_setopt( $handle, CURLOPT_TIMEOUT, $timeout );

curl_setopt( $handle, CURLOPT_URL, $url);
curl_setopt( $handle, CURLOPT_RETURNTRANSFER, true );
Expand Down

0 comments on commit 6f24b87

Please sign in to comment.