WordPress.org

Make WordPress Core

Opened 14 months ago

Closed 8 months ago

Last modified 8 months ago

#23463 closed defect (bug) (fixed)

WP_HTTP HTTP/1.1 needs to send Connection Close + support Transfer-encoding better

Reported by: dd32 Owned by: dd32
Milestone: 3.7 Priority: normal
Severity: normal Version:
Component: HTTP API Keywords:
Focuses: Cc:

Description

WP_HTTP accepts a 'httpversion' argument, and supports some functions of it (such as Transfer-encoding).

However, there are 2 things which are rather broken

  1. It doesn't send a Connection: close header, so the connection is held open and WP_HTTP never returns
  2. Transfer-Encoding: chunked appears to be rather broken, causing it to returning the end of the document rather than the decoded document.

The attached patch goes some of the way towards making that work better, but is mostly untested, and could do with a unit test or two.

Attachments (1)

23463.diff (1.0 KB) - added by dd32 14 months ago.

Download all attachments as: .zip

Change History (5)

dd3214 months ago

comment:1 dd328 months ago

In 25150:

WP_HTTP: When requesting a document with HTTP/1.1 include the 'Connection: Close' header (unless a Connection header is already specified) to prevent the connection being held open and hanging the request process. See #23463

comment:2 dd328 months ago

  • Keywords has-patch removed
  • Milestone changed from Future Release to 3.7

comment:3 dd328 months ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 25153:

WP_HTTP: Improve WP_HTTP::chunkTransferDecode() to properly handle binary data and chunked responses which include data in the page that looks like a chunked response.
This also fixes a case where the gzip'd data would become corrupt after chunked decoding as \r\n was replaced with \n in the data stream. Fixes #23463

comment:4 dd328 months ago

In 25155:

WP_HTTP: Fix a variable typo in [25153] See #23463

Note: See TracTickets for help on using tickets.