Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#33271 closed defect (bug) (invalid)

WP_Http streaming should use 'w' mode, not 'w+'

Reported by: rmccue's profile rmccue Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: HTTP API Keywords: needs-testing has-patch
Focuses: Cc:


WP_Http currently tries to open the stream handle using w+. When you're using a stream wrapper that doesn't support w+, this can be problematic. :(

As far as I can tell, only w is actually needed, not w+. The only operations both the cURL and socket transports do is fopen, fwrite, fclose, which is well within the ability of w.

Attachments (1)

33271.diff (1.5 KB) - added by dkotter 8 years ago.

Download all attachments as: .zip

Change History (5)

#1 @dd32
9 years ago

Sounds sane.

#2 @johnbillion
9 years ago

  • Keywords needs-patch needs-testing added

8 years ago

#3 @dkotter
8 years ago

  • Keywords has-patch added; needs-patch removed

Added a patch that changes this. Ran some tests to make sure things still worked as expected (basically just pulled the file stream tests from our unit tests) and everything still worked great for me.

#4 @dd32
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

As we've switched to using Requests this is no longer an issue, as it uses wb for the streaming file.

Marking this as invalid.

Note: See TracTickets for help on using tickets.