cvs: php4 /main network.c

From: Date: Sun, 11 Aug 2002 11:25:24 +0000
Subject: cvs: php4 /main network.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-13259@lists.php.net to get a copy of this message
wez Sun Aug 11 07:25:24 2002 EDT Modified files: /php4/main network.c Log: More verbosity when activating SSL on a socket fails. Index: php4/main/network.c diff -u php4/main/network.c:1.56 php4/main/network.c:1.57 --- php4/main/network.c:1.56 Fri Aug 9 23:03:03 2002 +++ php4/main/network.c Sun Aug 11 07:25:24 2002 @@ -15,7 +15,7 @@ | Author: Stig Venaas <venaas@uninett.no> | +----------------------------------------------------------------------+ */ -/* $Id: network.c,v 1.56 2002/08/10 03:03:03 sebastian Exp $ */ +/* $Id: network.c,v 1.57 2002/08/11 11:25:24 wez Exp $ */ /*#define DEBUG_MAIN_NETWORK 1*/ #define MAX_CHUNKS_PER_READ 10 @@ -581,19 +581,24 @@ php_netstream_data_t *sock = (php_netstream_data_t*)stream->abstract; SSL_CTX *ctx = NULL; - if (!php_stream_is(stream, PHP_STREAM_IS_SOCKET)) + if (!php_stream_is(stream, PHP_STREAM_IS_SOCKET)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_stream_sock_ssl_activate_with_method: stream is not a network stream"); return FAILURE; + } if (activate == sock->ssl_active) return SUCCESS; /* already in desired mode */ if (activate && sock->ssl_handle == NULL) { ctx = SSL_CTX_new(method); - if (ctx == NULL) + if (ctx == NULL) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_stream_sock_ssl_activate_with_method: failed to create an SSL context"); return FAILURE; + } sock->ssl_handle = SSL_new(ctx); if (sock->ssl_handle == NULL) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_stream_sock_ssl_activate_with_method: failed to create an SSL handle"); SSL_CTX_free(ctx); return FAILURE; } @@ -603,6 +608,7 @@ if (activate) { if (SSL_connect(sock->ssl_handle) <= 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_stream_sock_ssl_activate_with_method: SSL handshake/connection failed"); SSL_shutdown(sock->ssl_handle); return FAILURE; }

« previous php.cvs (#13259) next »