ID:               41236
 Updated by:       [EMAIL PROTECTED]
 Reported By:      judas dot iscariote at gmail dot com
-Status:           Assigned
+Status:           Bogus
 Bug Type:         Streams related
 Operating System: linux 32/64bit, Win32
 PHP Version:      5CVS-2007-04-30 (CVS)
 Assigned To:      iliaa
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

The thing is that the original SSL code was working in an identical 
manner.

Adding var_dump() shows that the return value of the 
stream_get_meta_data() or feof() did not change.


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

[2007-04-30 07:20:11] judas dot iscariote at gmail dot com

Description:
------------
Since PHP 5.2.1, our application that has jabber stopped working.all
previuos PHP version works fine, this regression is caused by the fix
for bug  #39571,reverting xp_ssl.c to the version shipped with 5.2.0
solves the problem.

Reproduce code:
---------------
./configure --with-openssl 

<?php

error_reporting(E_ALL);

$j = fsockopen('ssl://jabber.org', 5223,  $errorno, $errorstr, 10);

socket_set_blocking($j, 0);
socket_set_timeout($j, 5);

fwrite($j,"<?xml version='1.0' encoding='UTF-8' ?>");
fwrite($j, "<stream:stream to='jabber.org' xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>");

$data = '';
// Wait for a response until timeout is reached
$start = time();
$data = '';
$timeout = 10;
$wait = false;

do {
    $read = trim(fread($j, 4096));
    $data .= $read;

// ok.. this check aint part of the original code
// that breaks,but check if we timed out of reached eof..anyway..
$foo = stream_get_meta_data($j);
if(feof($j) || $foo['timed_out'] || $foo['eof']) break;

// yeah, we know aint nice, but works in **any** other PHP version.
} while (time() <= $start + $timeout && ($wait || $data == '' || $read
!= '' || (substr(rtrim($data), -1) != '>')));

fclose($j);

var_dump($data);

?>

Expected result:
----------------
response from the server var_dump'ed as in (all) previous versions

Actual result:
--------------
Fatal error: Maximum execution time of **30** seconds exceeded...an
xdebug session reveals that the script hang, in a **single** fread()
call

an strace shows something hangs permanently with EAGAIN signal..
(probably the loop in xp_ssl.c from line 398 to 410), note that checking
if has reached EOF or if the stream times out does not help either.




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


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

Reply via email to