#41489 [Csd->Opn]: stream_select does not work on ssl stream_socket_server (works in 5.2.1!) on 64b

From: Date: Fri, 29 Jun 2007 19:59:05 +0000
Subject: #41489 [Csd->Opn]: stream_select does not work on ssl stream_socket_server (works in 5.2.1!) on 64b
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-114469@lists.php.net to get a copy of this message
 ID:               41489
 User updated by:  n dot escuder at intra-links dot com
-Summary:          stream_select does not work on ssl
                   stream_socket_server (works in 5.2.1!)
 Reported By:      n dot escuder at intra-links dot com
-Status:           Closed
+Status:           Open
 Bug Type:         Streams related
 Operating System: Linux 2.6
-PHP Version:      5.2.2
+PHP Version:      5.2.3
 New Comment:

Ok now it's good on 32 bit plateform but not on 64 bit.

If i compile 32 bit version of PHP this works.

If i compile 64 bit version of PHP your patch don't work.


Previous Comments:
------------------------------------------------------------------------

[2007-05-27 17:06:17] iliaa@php.net

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.



------------------------------------------------------------------------

[2007-05-24 13:09:30] n dot escuder at intra-links dot com

Description:
------------
When creating an socket server in ssl mode stream_select don't work.

In PHP 5.2.1 all work fine the bug is in PHP 5.2.2.

Reproduce code:
---------------
server.php:

$options = array( "ssl" => array( "allow_self_signed" => true,
"verify_peer" => false, "local_cert" =>
"/www/conf/ssl/server.pem" ) );
$context = stream_context_create();
stream_context_set_option( $context, $options );

$s = stream_socket_server( "ssl://0.0.0.0:6310", $errno, $errstr,
STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context );
while ( 1 ) {
   $read = array( $s );
   $wr = null;
   $ed = null;
   if ( stream_select( $read, $wr, $ed, 0, 500 ) > 0 ) {
      echo "ACCEPT\n";
   }
}

client.php:

$s = stream_socket_client( "ssl://localhost:6310" );
$s->write("toto\r\n\r\n");
sleep( 1 );


Expected result:
----------------
when running server.php we must go "ACCEPT" onto the screen.

Actual result:
--------------
nothing


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41489&edit=1


Thread (22 messages)

« previous php.bugs (#114469) next »