Make WordPress Core


Ignore:
Timestamp:
01/29/2015 03:57:42 AM (12 years ago)
Author:
dd32
Message:

HTTP API: Fix an issue where the limit_response_size parameter wasn't working properly with large documents and the cURL transport.
Fixes #31172

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-http.php

    r31126 r31290  
    15211521                // If an error occurred, or, no response.
    15221522                if ( $curl_error || ( 0 == strlen( $theBody ) && empty( $theHeaders['headers'] ) ) ) {
    1523                         if ( CURLE_WRITE_ERROR /* 23 */ == $curl_error && $r['stream'] ) {
     1523                        if ( CURLE_WRITE_ERROR /* 23 */ == $curl_error ) {
    15241524                                if ( ! $this->max_body_length || $this->max_body_length != $bytes_written_total ) {
    1525                                         fclose( $this->stream_handle );
    1526                                         return new WP_Error( 'http_request_failed', __( 'Failed to write request to temporary file.' ) );
     1525                                        if ( $r['stream'] ) {
     1526                                                curl_close( $handle );
     1527                                                fclose( $this->stream_handle );
     1528                                                return new WP_Error( 'http_request_failed', __( 'Failed to write request to temporary file.' ) );
     1529                                        } else {
     1530                                                curl_close( $handle );
     1531                                                return new WP_Error( 'http_request_failed', curl_error( $handle ) );
     1532                                        }
    15271533                                }
    15281534                        } else {
Note: See TracChangeset for help on using the changeset viewer.