Make WordPress Core

Ticket #13841: 13841.2.diff

File 13841.2.diff, 851 bytes (added by sivel, 14 years ago)

Refreshed patch

  • wp-includes/class-http.php

     
    748748                }
    749749
    750750                $strResponse = '';
    751                 while ( ! feof($handle) )
     751                while ( ! feof($handle) ) {
     752                        $info = stream_get_meta_data($handle);
     753                        if ( $info['timed_out'] )
     754                                return new WP_Error('http_request_failed', __('Request timed out.'));
    752755                        $strResponse .= fread($handle, 4096);
     756                }
    753757
    754758                fclose($handle);
    755759
     
    10551059                if ( ! empty($r['body'] ) )
    10561060                        $arrContext['http']['content'] = $r['body'];
    10571061
     1062                // timeouts with stream_contect_create for some reason need to be half of what you expect
     1063                $arrContext['http']['timeout'] = $r['timeout'] / 2;
     1064
    10581065                $context = stream_context_create($arrContext);
    10591066
    10601067                if ( !WP_DEBUG )