ID:               45016
 Updated by:       [EMAIL PROTECTED]
 Reported By:      tpowell at electric-cloud dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         OpenSSL related
-Operating System: all
+Operating System: *
 PHP Version:      5.3CVS-2008-05-16 (CVS)
 New Comment:

Can you try the patch Kalle posted above?


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

[2008-07-08 01:39:54] [EMAIL PROTECTED]

Try this patch:
http://phpfi.com/330065 (against latest PHP_5_3 cvs)

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

[2008-05-16 00:12:40] tpowell at electric-cloud dot com

Description:
------------
On unusually slow ssl connects, we get a timeout message even through
the connect succeeded.

The offending code appears to be around line 816 of xp_ssl.c version
1.37  (the bug appears to have been around since 1.28)

                                struct timeval tvs, tve;
                                struct timezone tz;

                                gettimeofday(&tvs, &tz);
                                n = SSL_connect(sslsock->ssl_handle);
                                gettimeofday(&tve, &tz);

                                timeout -= (tve.tv_sec + tve.tv_usec /
1000000) - (tvs.tv_sec + tvs.tv_usec / 1000000);
                                if (timeout < 0) {
                                        php_error_docref(NULL
TSRMLS_CC, E_WARNING, "SSL: connection timeout");
                                        return -1;
                                }


The timeout is checked before the success value.  A fix would be to
only check the timeout when deciding to loop again.

Reproduce code:
---------------
Peg the cpu of the test machine, attempt to make several ssl
connections out.



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


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

Reply via email to