]> granicus.if.org Git - php/commitdiff
MFB53: Fixed bug#44716 (Progress notifications incorrect)
authorHannes Magnusson <bjori@php.net>
Mon, 14 Apr 2008 12:17:38 +0000 (12:17 +0000)
committerHannes Magnusson <bjori@php.net>
Mon, 14 Apr 2008 12:17:38 +0000 (12:17 +0000)
ext/openssl/xp_ssl.c

index 3523a5ee2b989e04e36bb07c9feb89407a0aa7bb..b0ed9b60f968ac36098531e1ad0dd10471ae9b91 100644 (file)
@@ -198,14 +198,13 @@ static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size
                                break;
                        }
                } while(retry);
-               
+
+               if (didwrite > 0) {
+                       php_stream_notify_progress_increment(stream->context, didwrite, 0);
+               }
        } else {
                didwrite = php_stream_socket_ops.write(stream, buf, count TSRMLS_CC);
        }
-       
-       if (didwrite > 0) {
-               php_stream_notify_progress_increment(stream->context, didwrite, 0);
-       }
 
        if (didwrite < 0) {
                didwrite = 0;
@@ -234,16 +233,16 @@ static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t coun
                                break;
                        }
                } while (retry);
+
+               if (nr_bytes > 0) {
+                       php_stream_notify_progress_increment(stream->context, nr_bytes, 0);
+               }
        }
        else
        {
                nr_bytes = php_stream_socket_ops.read(stream, buf, count TSRMLS_CC);
        }
 
-       if (nr_bytes > 0) {
-               php_stream_notify_progress_increment(stream->context, nr_bytes, 0);
-       }
-
        if (nr_bytes < 0) {
                nr_bytes = 0;
        }