Make WordPress Core

Opened 15 years ago

Closed 11 years ago

#9072 closed enhancement (maybelater)

New Socket HTTP transport to use stream_socket_client

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

Description

Steams use of stream_socket_client:

  • Support SSL.
  • Better support for non-blocking.
  • Damn sexy.

Attachments (2)

9072.diff (2.4 KB) - added by jacobsantos 15 years ago.
Uses stream_socket_client instead of fopen.
9072.patch (11.6 KB) - added by jacobsantos 14 years ago.
Tested and working patch for Sockets. Will need a bit more testing, but it does handle requests and appears to work fine.

Download all attachments as: .zip

Change History (22)

@jacobsantos
15 years ago

Uses stream_socket_client instead of fopen.

#1 @jacobsantos
15 years ago

  • Keywords has-patch needs-testing added

Needs crazy amount of testing.

#2 @westi
15 years ago

  • Cc westi added

Good work Jacob :-)

#3 @beaulebens
15 years ago

All of the *-streams.php tests in your http-tests suite fail for me now, and I get the following error when viewing them individually:

HTTP socket error 47731900: Unable to find the socket transport "http" - did you forget to enable it when you configured PHP? for http://localhost/

Even though I've got these showing in phpinfo()

Registered PHP Streams => zip, php, file, data, http, ftp, compress.bzip2, compress.zlib, https, ftps  
Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv3, sslv2, tls

and PHP claims "Streams are an integral part of PHP as of version 4.3.0. No steps are required to enable them."

??

#4 @jacobsantos
15 years ago

  • Keywords needs-patch added; has-patch removed

#5 @jacobsantos
15 years ago

See the problem is that we are doing Streams not Sockets. In which case, the https, should work for SSL. That we need to use Sockets for SSL is a problem.

#6 @Denis-de-Bernardy
15 years ago

future? or is anyone volunteering to get this into 2.8?

#7 @Denis-de-Bernardy
15 years ago

  • Milestone changed from 2.8 to Future Release

#8 @Denis-de-Bernardy
15 years ago

  • Milestone changed from Future Release to 2.9

#9 follow-up: @Denis-de-Bernardy
15 years ago

  • Milestone changed from 2.9 to Future Release

stream_socket_client is php5...

#10 in reply to: ↑ 9 @jacobsantos
14 years ago

Replying to Denis-de-Bernardy:

stream_socket_client is php5...

The class itself is for PHP5, so it doesn't really matter. I did some research a while back and this is the recommended way to do this since it also supports non-blocking requests, which would be good to have.

I'm not sure what my interest is on this. I'll be doing some more work on the HTTP API, but the work may not include this work. That said, the non-blocking might be better to implement for what I'm wanting the HTTP API to do.

#11 @jacobsantos
14 years ago

  • Owner set to jacobsantos
  • Status changed from new to accepted

#12 @jacobsantos
14 years ago

I'm going to accept it for now. If not, then I'll just change the status back to new.

#13 @jacobsantos
14 years ago

Basically, it is handled more like a socket than it is a stream. Therefore working with it is more like fsockopen than fopen with context. I'm almost done, but it is going to require a lot of testing.

@jacobsantos
14 years ago

Tested and working patch for Sockets. Will need a bit more testing, but it does handle requests and appears to work fine.

#14 @jacobsantos
14 years ago

New patch for testing.

#15 @jacobsantos
14 years ago

  • Summary changed from Convert Streams HTTP transport to use stream_socket_client for SSL and whatever to New Socket HTTP transport to use stream_socket_client

#16 @jacobsantos
14 years ago

  • Keywords has-patch added; needs-patch removed

#17 @jacobsantos
12 years ago

  • Owner jacobsantos deleted
  • Status changed from accepted to assigned

#18 @jacobsantos
12 years ago

  • Cc wordpress@… added

#19 @jacobsantos
12 years ago

  • Cc wordpress@… removed

#20 @dd32
11 years ago

  • Milestone Future Release deleted
  • Resolution set to maybelater
  • Status changed from assigned to closed

Ticket has been dormant for years, The patch is significantly out of date, and we have no intentions of adding an extra transport to support to the API right now.
If a need arrises we can resurrect this ticket.

Note: See TracTickets for help on using tickets.