]> granicus.if.org Git - php/commitdiff
Fix for bug #10001: a timeout event prevents further reads.
authorWez Furlong <wez@php.net>
Mon, 18 Mar 2002 20:13:50 +0000 (20:13 +0000)
committerWez Furlong <wez@php.net>
Mon, 18 Mar 2002 20:13:50 +0000 (20:13 +0000)
The Bug DB has a patch that should be applied to fsock.c on the
4.2 branch.

main/network.c

index d8a69ebd67bdc8a752fa5bf0d37cebf57860908f..25284a8eb8ffb80a6bdb934bc9f2b8d6274792de 100644 (file)
@@ -678,6 +678,7 @@ static size_t php_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS
        size_t ret = 0;
 
        if (sock->is_blocked)   {
+               sock->timeout_event = 0;
                while(!sock->eof && TOREAD(sock) < count && !sock->timeout_event)
                        php_sock_stream_read_internal(stream, sock TSRMLS_CC);
        }
@@ -791,6 +792,8 @@ static char *php_sockop_gets(php_stream *stream, char *buf, size_t maxlen TSRMLS
 
        if(!p) {
                if(sock->is_blocked) {
+                       sock->timeout_event = 0;
+                       
                        while(!p && !sock->eof && !sock->timeout_event && TOREAD(sock) < maxlen) {
                                php_sock_stream_read_internal(stream, sock TSRMLS_CC);
                                SEARCHCR();