WordPress.org

Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #16855, comment 21


Ignore:
Timestamp:
03/20/2011 09:46:48 PM (7 years ago)
Author:
cogmios
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #16855, comment 21

    v1 v2  
    1 I also notice the following but maybe Im totally wrong there is the line:
    2 {{{
    3 if ( true === $r['blocking'] )
    4                 {
    5                         curl_setopt( $handle, CURLOPT_HEADER, true );
    6                 }       
    7                 else
    8                 {                               
    9                         curl_setopt( $handle, CURLOPT_HEADER, false );
    10                         echo "oh oh ";
    11                 }
    12 }}}
    13 
    14 (I put the oh oh there)
    15 
    16 If I call wp_remote-whatever with this:
    17 
    18 {{{
    19 $http_args_get = array (
    20                                 'method' => 'GET',
    21                                 'timeout' => 300,
    22                                 'redirection' => 0,
    23                                 'httpversion' => '1.0',
    24                                 'user-agent' => "WordPress",
    25                                 'blocking' => true,
    26                                 'headers' => array(),
    27                                 'cookies' => array(),
    28                                 'body' => null,
    29                                 'compress' => false,
    30                                 'decompress' => true,
    31                                 'sslverify' => false,
    32                             'followlocation' => false
    33                         );
    34 $response = wp_remote_get('http://www.informationweek.com/story/',$http_args_get);
    35 }}}
    36 
    37 (so with blocking set to true)
    38 It Will ALWAYS fall in the "oh oh" loop because it gets converted to "1" in the array.
    39 
    40 But probably I do something wrong. Here is the output of the array:
    41 {{{
    42 oh oh [-- Response: --](http://www.informationweek.com/story/)
    43 Array ( [method] => GET [timeout] => 300 [redirection] => 0 [httpversion] => 1.0
    44 [followlocation] => [blocking] => 1 [headers] => Array ( [Accept-Encoding] =>
    45 deflate;q=1.0, compress;q=0.5 ) [body] => [cookies] => Array ( ) [user-agent] =>
    46 WordPress/WP-Favicons/http://127.0.0.1/wp2 [compress] => [decompress] => 1 [sslverify] =>
    47 [ssl] => [local] => ) [-- R: 1--](http://www.informationweek.com/story/)
    48 WP_Error Object ( [errors] => Array ( [http_request_failed] => Array ( [0] => Maximum (0)
    49 redirects followed ) ) [error_data] => Array ( ) )
    50 }}}
    51 
    52 
    53 
    54 
    55 
    56 
    57 
     1deleted