Changeset 8519
- Timestamp:
- 08/01/2008 04:36:50 PM (16 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/cron.php
r8516 r8519 91 91 $cron_url = get_option( 'siteurl' ) . '/wp-cron.php?check=' . wp_hash('187425'); 92 92 93 wp_remote_post($cron_url, array('timeout' => 0.01 ));93 wp_remote_post($cron_url, array('timeout' => 0.01, 'blocking' => false)); 94 94 } 95 95 -
trunk/wp-includes/http.php
r8518 r8519 116 116 'method' => 'GET', 'timeout' => 3, 117 117 'redirection' => 5, 'redirected' => false, 118 'httpversion' => '1.0' 118 'httpversion' => '1.0', 'blocking' => true 119 119 ); 120 120 … … 262 262 263 263 $newheaders = array(); 264 foreach ($headers as $tempheader) {264 foreach ( $headers as $tempheader ) { 265 265 if ( empty($tempheader) ) 266 266 continue; … … 307 307 $defaults = array( 308 308 'method' => 'GET', 'timeout' => 3, 309 'redirection' => 5, 'httpversion' => '1.0' 309 'redirection' => 5, 'httpversion' => '1.0', 310 'blocking' => true 310 311 ); 311 312 … … 324 325 $arrURL['port'] = apply_filters('http_request_default_port', 443); 325 326 $secure_transport = true; 327 } else { 328 $arrURL['port'] = apply_filters('http_request_default_port', 80); 326 329 } 327 else328 $arrURL['port'] = apply_filters('http_request_default_port', 80);330 } else { 331 $arrURL['port'] = apply_filters('http_request_port', $arrURL['port']); 329 332 } 330 else331 $arrURL['port'] = apply_filters('http_request_port', $arrURL['port']);332 333 333 334 if ( true === $secure_transport ) … … 336 337 $handle = fsockopen($arrURL['host'], $arrURL['port'], $iError, $strError, apply_filters('http_request_timeout', absint($r['timeout']) ) ); 337 338 338 if ( false === $handle ) {339 if ( false === $handle ) 339 340 return new WP_Error('http_request_failed', $iError . ': ' . $strError); 340 }341 341 342 342 $requestPath = $arrURL['path'] . ( isset($arrURL['query']) ? '?' . $arrURL['query'] : '' ); 343 $requestPath = (empty($requestPath)) ? '/' : $requestPath;343 $requestPath = empty($requestPath) ? '/' : $requestPath; 344 344 345 345 $strHeaders = ''; … … 348 348 349 349 if ( is_array($header) ) { 350 foreach ( (array) $this->getHeaders() as $header => $headerValue)350 foreach ( (array) $this->getHeaders() as $header => $headerValue ) 351 351 $strHeaders .= $header . ': ' . $headerValue . "\r\n"; 352 } else 352 } else { 353 353 $strHeaders .= $header; 354 } 354 355 355 356 $strHeaders .= "\r\n"; … … 359 360 360 361 fwrite($handle, $strHeaders); 362 363 if ( ! $r['blocking'] ) 364 return array( 'headers' => array(), 'body' => '', 'response' => array() ); 361 365 362 366 $strResponse = ''; … … 431 435 $defaults = array( 432 436 'method' => 'GET', 'timeout' => 3, 433 'redirection' => 5, 'httpversion' => '1.0' 437 'redirection' => 5, 'httpversion' => '1.0', 438 'blocking' => true 434 439 ); 435 440 … … 448 453 if ( function_exists('stream_set_timeout') ) 449 454 stream_set_timeout($handle, apply_filters('http_request_timeout', $r['timeout']) ); 455 456 if ( ! $r['blocking'] ) 457 return array( 'headers' => array(), 'body' => '', 'response' => array() ); 450 458 451 459 $strResponse = ''; … … 508 516 $defaults = array( 509 517 'method' => 'GET', 'timeout' => 3, 510 'redirection' => 5, 'httpversion' => '1.0' 518 'redirection' => 5, 'httpversion' => '1.0', 519 'blocking' => true 511 520 ); 512 521 … … 537 546 stream_set_timeout($handle, apply_filters('http_request_stream_timeout', $this->timeout) ); 538 547 539 if ( ! $handle)548 if ( ! $handle) 540 549 return new WP_Error('http_request_failed', sprintf(__('Could not open handle for fopen() to %s'), $url)); 550 551 if ( ! $r['blocking'] ) 552 return array( 'headers' => array(), 'body' => '', 'response' => array() ); 541 553 542 554 $strResponse = stream_get_contents($handle); … … 575 587 * 576 588 * Last ditch effort to retrieve the URL before complete failure. 589 * Does not support non-blocking requests. 577 590 * 578 591 * @package WordPress … … 599 612 'method' => 'GET', 'timeout' => 3, 600 613 'redirection' => 5, 'httpversion' => '1.0', 601 ' user_agent' => apply_filters('http_headers_useragent', 'WordPress/' . $wp_version)614 'blocking' => true, 'user_agent' => apply_filters('http_headers_useragent', 'WordPress/' . $wp_version) 602 615 ); 603 616
Note: See TracChangeset
for help on using the changeset viewer.