Re: Moving Socket extension to PECL

From: Date: Sat, 10 Feb 2007 22:43:30 +0000
Subject: Re: Moving Socket extension to PECL
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-27993@lists.php.net to get a copy of this message
Hi once again,
In my first tests I also included support for streams (using stream_select) in order to support SSL/TLS enabled connections. However, the SSL transport layer in the Stream "extension" is totally screwed up if you use asynchronous socket streams.
That's the first I've heard about this; I've been using it in this fashion successfully for some time.
Don't have time for a test case right now; but I've checked the code and remembered (parts of) the problem: 1) If you're using non-blocking SSL streams then fread sometimes returns int(0) which actually means SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE. 2) stream_select() returns write and read arrays for the async. SSL stream even if there's no user data (but SSL protocol data). For a quick example, just have a look at your own code (add SSL): guru-multiplexing.php @http://www.php.net/~wez/guru-multiplexing.tgz (and don't forget STREAM_CLIENT_CONNECT in stream_client_connect ;-) Maurice.

« previous php.internals (#27993) next »