Make WordPress Core

Ticket #13841: 13841.3.patch

File 13841.3.patch, 822 bytes (added by hakre, 14 years ago)

stream_set_timeout()

  • wp-includes/class-http.php

    ### Eclipse Workspace Patch 1.0
    #P wordpress-trunk
     
    871871                if ( ! $handle )
    872872                        return new WP_Error('http_request_failed', sprintf(__('Could not open handle for fopen() to %s'), $url));
    873873
    874                 $timeout = (int) floor( $r['timeout'] );
    875                 $utimeout = $timeout == $r['timeout'] ? 0 : 1000000 * $r['timeout'] % 1000000;
    876                 stream_set_timeout( $handle, $timeout, $utimeout );
     874                $timeout_int = (int) $r['timeout'];
     875                $timeout_micro = ( $r['timeout'] - $timeout_int ) * 1000000;
     876                stream_set_timeout( $handle, $timeout_int, $timeout_micro );
    877877
    878878                if ( ! $r['blocking'] ) {
    879879                        stream_set_blocking($handle, 0);