From 9549319cc4df6521ba27e949e8a4991a67ee67aa Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 7 Aug 2008 22:57:16 +0000 Subject: [PATCH] Fixes cURL for Cron in non-blocking mode. Props santosj. fixes #7481 see #4779 git-svn-id: http://svn.automattic.com/wordpress/trunk@8584 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/http.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/http.php b/wp-includes/http.php index 70ef57768..23c816a84 100644 --- a/wp-includes/http.php +++ b/wp-includes/http.php @@ -871,9 +871,11 @@ class WP_Http_Curl { if ( true === $r['blocking'] ) { curl_setopt( $handle, CURLOPT_HEADER, true ); + curl_setopt( $handle, CURLOPT_RETURNTRANSFER, 1 ); } else { curl_setopt( $handle, CURLOPT_HEADER, false ); curl_setopt( $handle, CURLOPT_NOBODY, true ); + curl_setopt( $handle, CURLOPT_RETURNTRANSFER, 0 ); } curl_setopt( $handle, CURLOPT_RETURNTRANSFER, 1 ); @@ -894,6 +896,7 @@ class WP_Http_Curl { curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 ); if ( ! $r['blocking'] ) { + curl_exec( $handle ); curl_close( $handle ); return array( 'headers' => array(), 'body' => '', 'response' => array('code', 'message') ); }