Make WordPress Core

Opened 7 years ago

Closed 6 years ago

#7793 closed enhancement (fixed)

Transition all fsockopen, fopen, and curl to HTTP API

Reported by: jacobsantos Owned by: jacobsantos
Milestone: 2.7 Priority: normal
Severity: normal Version: 2.7
Component: Optimization Keywords: http has-patch commit
Focuses: Cc:


Ticket is for transitioning the remaining functions over to the HTTP API. This does not include the dependencies on Snoopy, but it might in the future. It also does not include the SSL remote URL check, I'm not sure how to achieve that using the API (look for 200 maybe and check that URL was not redirected, maybe).

Supercedes #7224, #7676, and #7751.

Discussion on removing Snoopy can also begin. I'll start, basically since Magpie requires it, it might be best to leave it alone. The core of WordPress now doesn't use it (I'll confirm that), so it might not make sense refactoring an external library to use a WordPress one.

Attachments (3)

7793.r8984.diff (14.2 KB) - added by jacobsantos 7 years ago.
HTTP API transition based on r8984
7793.r9046.diff (2.3 KB) - added by jacobsantos 6 years ago.
Error checking for the HTTP API based off of r9046
7793.diff (854 bytes) - added by DD32 6 years ago.
download_url() from snoopy -> HTTP API (Attempt 2..)

Download all attachments as: .zip

Change History (20)

@jacobsantos7 years ago

HTTP API transition based on r8984

comment:1 @jacobsantos7 years ago

  • Keywords has-patch needs-testing added

Needs crazy amount of testing.

comment:2 @westi6 years ago

(In [9011]) Move the link timestamp updater to the new HTTP api. See #7793 props jacobsantos.

comment:3 @westi6 years ago

(In [9012]) Move the pingbacks and trackbacks to the new HTTP api. See #7793 props jacobsantos.

comment:4 @westi6 years ago

(In [9013]) Move the old simple http method to use the new HTTP api. See #7793 props jacobsantos.

@jacobsantos6 years ago

Error checking for the HTTP API based off of r9046

comment:5 @jacobsantos6 years ago

  • Keywords commit added; needs-testing removed

comment:6 @ryan6 years ago

(In [9051]) Error checking for HTTP requests. Props jacobsantos. see #7793

comment:7 @DD326 years ago

  • Version set to 2.7

attachment 7793.diff added.

converts download_url() from snoopy to the new HTTP API

@DD326 years ago

download_url() from snoopy -> HTTP API (Attempt 2..)

comment:8 @ryan6 years ago

(In [9142]) Convert download_url() to http api. Props DD32. see #7793

comment:9 @ryan6 years ago

download_url() now fails for me. It returns a 0 length file when downloading the nightly build. Get transport is curl. Post transport is streams.

comment:10 @ryan6 years ago

Response is:

array(3) { ["headers"]=>  array(0) { } ["body"]=>  string(0) "" ["response"]=>  array(2) { ["code"]=>  int(200) ["message"]=>  string(2) "OK" } } 

comment:11 @DD326 years ago

sounds like you might have a problem with the curl transport, as its working for me with the HTTP Extension. I'll have a look at if i get a chance today

comment:12 @ryan6 years ago

curl_error() says:

Operation timed out after 3000 milliseconds with 1350984 out of 1815410 bytes received

comment:13 @westi6 years ago

3 seconds is the default timeout for the curl HTTP transport

comment:15 @ryan6 years ago

(In [9186]) Give downloads a longer timeout. see #7793

comment:16 @jacobsantos6 years ago

Should that be the rest of it? I'm not sure if you want to convert Magpie over to the HTTP API or not, but that should be the only one left. I didn't do a search for Snoopy, but I think I will for 2.8.

comment:17 @ryan6 years ago

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

Let's call it done for 2.7.

Note: See TracTickets for help on using tickets.