|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-04-04 10:51 UTC] tony2001@php.net
[2007-04-12 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 00:00:01 2025 UTC |
Description: ------------ Weird/contradictory error messages and memory leaks from an openssl enabled stream. Reproduce code: --------------- //example from the manual. <?php $socket = stream_socket_server("tls://0.0.0.0:8000", $errno, $errstr); if (!$socket) { echo "$errstr ($errno)<br />\n"; } else { while ($conn = stream_socket_accept($socket)) { fwrite($conn, 'The local time is ' . date('n/j/Y g:i a') . "\n"); fclose($conn); } fclose($socket); } ?> execute if from CLI and load point your browser to 127.0.0.1:8000 ( in my case, firefox) Expected result: ---------------- 1. No contrictory message stream_socket_accept(): accept failed: **Success** ( oh well,faliure or success ?? :-) ) 2. no memory leak. Actual result: -------------- PHP Warning: stream_socket_accept(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:func(143):reason(267) in /home/cristian/sock.php on line 8 Warning: stream_socket_accept(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:func(143):reason(267) in /home/cristian/sock.php on line 8 PHP Warning: stream_socket_accept(): Failed to enable crypto in /home/cristian/sock.php on line 8 Warning: stream_socket_accept(): Failed to enable crypto in /home/cristian/sock.php on line 8 PHP Warning: stream_socket_accept(): accept failed: Success in /home/cristian/sock.php on line 8 Warning: stream_socket_accept(): accept failed: Success in /home/cristian/sock.php on line 8 [Wed Apr 4 06:19:34 2007] Script: 'sock.php' /home/cristian/php5/ext/openssl/xp_ssl.c(157) : Freeing 0x00C2D5C0 (50 bytes), script=sock.php === Total 1 memory leaks detected ===