}
}
- if (didwrite > 0)
+ if (didwrite > 0) {
php_stream_notify_progress_increment(stream->context, didwrite, 0);
+ }
return didwrite;
}
if (sock->ssl_active) {
int retry = 1;
+ if (sock->is_blocked && !SSL_pending(sock->ssl_handle)) {
+ php_sock_stream_wait_for_data(stream, sock TSRMLS_CC);
+ if (sock->timeout_event) {
+ return 0;
+ }
+ }
+
do {
nr_bytes = SSL_read(sock->ssl_handle, buf, count);
{
if (sock->is_blocked) {
php_sock_stream_wait_for_data(stream, sock TSRMLS_CC);
- if (sock->timeout_event)
+ if (sock->timeout_event) {
return 0;
+ }
}
nr_bytes = recv(sock->socket, buf, count, 0);
}
}
- if (nr_bytes > 0)
+ if (nr_bytes > 0) {
php_stream_notify_progress_increment(stream->context, nr_bytes, 0);
+ }
return nr_bytes;
}
}
}
}
+
return alive;
}