summaryrefslogtreecommitdiff
path: root/ext/openssl/xp_ssl.c
diff options
context:
space:
mode:
authorFerenc Kovacs <tyrael@php.net>2014-10-15 19:34:07 +0200
committerFerenc Kovacs <tyrael@php.net>2014-10-15 19:34:07 +0200
commitfeadaaed560891b2157057e9dadd2c3f48a90a60 (patch)
treebbc5a1ccc580c91a4b8558e75c4f7b766617556b /ext/openssl/xp_ssl.c
parent4fb998d42fb517e4888124c809bbc1046e76a0c6 (diff)
downloadphp-git-feadaaed560891b2157057e9dadd2c3f48a90a60.tar.gz
Revert "Merge branch 'PHP-5.5' into PHP-5.6"
This reverts commit 98e67add15a6b889efe152c23ed15a61f022a63a, reversing changes made to 2cdc1a2b7473eff27c224c66dcb85118b553a147.
Diffstat (limited to 'ext/openssl/xp_ssl.c')
-rw-r--r--ext/openssl/xp_ssl.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index 2a50f07ef6..debd1f16d2 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -1807,59 +1807,13 @@ static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size
}
/* }}} */
-static void php_openssl_stream_wait_for_data(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;
- php_netstream_data_t *sock;
int nr_bytes = 0;
if (sslsock->ssl_active) {
int retry = 1;
- sock = (php_netstream_data_t*)stream->abstract;
-
- /* The SSL_read() function will block indefinitely waiting for data on a blocking
- socket. If we don't poll for readability first this operation has the potential
- to hang forever. To avoid this scenario we poll with a timeout before performing
- the actual read. If it times out we're finished.
- */
- if (sock->is_blocked) {
- php_openssl_stream_wait_for_data(sock);
- if (sock->timeout_event) {
- stream->eof = 1;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL read operation timed out");
- return nr_bytes;
- }
- }
do {
nr_bytes = SSL_read(sslsock->ssl_handle, buf, count);