Skip to content

Commit 2f3adeb

Browse files
committed
- Revert r313616 (When we have a blocking SSL socket, respect the timeout
option, scottmac) # This caused bug #55283 and #55848, we should investigate a proper solution without # breaking anything.
1 parent 567e2f1 commit 2f3adeb

File tree

2 files changed

+4
-37
lines changed

2 files changed

+4
-37
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ PHP NEWS
1515
. Fixed bug #55825 (Missing initial value of static locals in trait methods).
1616
(Laruence)
1717

18+
- Openssl
19+
- Revert r313616 (When we have a blocking SSL socket, respect the timeout
20+
option, scottmac), breaks ssl support as described in bugs #55283 and #55848
21+
1822
- Sysvshm
1923
. Fixed bug #55750 (memory copy issue in sysvshm extension).
2024
(Ilia, jeffhuang9999 at gmail dot com)

ext/openssl/xp_ssl.c

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -204,36 +204,6 @@ static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size
204204
return didwrite;
205205
}
206206

207-
static void php_openssl_stream_wait_for_data(php_stream *stream, php_netstream_data_t *sock TSRMLS_DC)
208-
{
209-
int retval;
210-
struct timeval *ptimeout;
211-
212-
if (sock->socket == -1) {
213-
return;
214-
}
215-
216-
sock->timeout_event = 0;
217-
218-
if (sock->timeout.tv_sec == -1)
219-
ptimeout = NULL;
220-
else
221-
ptimeout = &sock->timeout;
222-
223-
while(1) {
224-
retval = php_pollfd_for(sock->socket, PHP_POLLREADABLE, ptimeout);
225-
226-
if (retval == 0)
227-
sock->timeout_event = 1;
228-
229-
if (retval >= 0)
230-
break;
231-
232-
if (php_socket_errno() != EINTR)
233-
break;
234-
}
235-
}
236-
237207
static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
238208
{
239209
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
243213
int retry = 1;
244214

245215
do {
246-
if (sslsock->s.is_blocked) {
247-
php_openssl_stream_wait_for_data(stream, &(sslsock->s) TSRMLS_CC);
248-
if (sslsock->s.timeout_event) {
249-
break;
250-
}
251-
/* there is no guarantee that there is application data available but something is there */
252-
}
253216
nr_bytes = SSL_read(sslsock->ssl_handle, buf, count);
254217

255218
if (nr_bytes <= 0) {

0 commit comments

Comments
 (0)