]> granicus.if.org Git - php/commitdiff
- Revert r313616 (When we have a blocking SSL socket, respect the timeout
authorPierre Joye <pajoye@php.net>
Wed, 5 Oct 2011 05:20:51 +0000 (05:20 +0000)
committerPierre Joye <pajoye@php.net>
Wed, 5 Oct 2011 05:20:51 +0000 (05:20 +0000)
  option, scottmac)

# This caused bug #55283 and #55848, we should investigate a proper solution without
# breaking anything.

NEWS
ext/openssl/xp_ssl.c

diff --git a/NEWS b/NEWS
index 4caac735775e8b40fef826fb1c7de8a055e1b881..3de5badcaf3bd7f65015fceb83fab1a6f84169c5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,10 @@ PHP                                                                        NEWS
   . Fixed bug #55825 (Missing initial value of static locals in trait methods).
     (Laruence)
 
+- Openssl
+- Revert r313616 (When we have a blocking SSL socket, respect the timeout
+  option, scottmac), breaks ssl support as described in bugs #55283 and #55848
+
 - Sysvshm
   . Fixed bug #55750 (memory copy issue in sysvshm extension).
     (Ilia, jeffhuang9999 at gmail dot com)
index 4b530408eb9e2aa1e54aaecfd304b5fc54e940aa..e4b101ef6adcf6f3109e872d372ccf5ef097dc55 100644 (file)
@@ -204,36 +204,6 @@ static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size
        return didwrite;
 }
 
-static void php_openssl_stream_wait_for_data(php_stream *stream, php_netstream_data_t *sock TSRMLS_DC)
-{
-       int retval;
-       struct timeval *ptimeout;
-
-       if (sock->socket == -1) {
-               return;
-       }
-       
-       sock->timeout_event = 0;
-
-       if (sock->timeout.tv_sec == -1)
-               ptimeout = NULL;
-       else
-               ptimeout = &sock->timeout;
-
-       while(1) {
-               retval = php_pollfd_for(sock->socket, PHP_POLLREADABLE, ptimeout);
-
-               if (retval == 0)
-                       sock->timeout_event = 1;
-
-               if (retval >= 0)
-                       break;
-
-               if (php_socket_errno() != EINTR)
-                       break;
-       }
-}
-
 static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
 {
        php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
@@ -243,13 +213,6 @@ static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t coun
                int retry = 1;
 
                do {
-                       if (sslsock->s.is_blocked) {
-                               php_openssl_stream_wait_for_data(stream, &(sslsock->s) TSRMLS_CC);
-                               if (sslsock->s.timeout_event) {
-                                       break;
-                               }
-                               /* there is no guarantee that there is application data available but something is there */
-                       }
                        nr_bytes = SSL_read(sslsock->ssl_handle, buf, count);
 
                        if (nr_bytes <= 0) {