diff options
author | Wez Furlong <wez@php.net> | 2002-03-16 18:42:42 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2002-03-16 18:42:42 +0000 |
commit | 5d0c53eecf5e720dd73d14c602a3df9c752e3a67 (patch) | |
tree | 2fc775e01a59df0517b6f4ae884ea238053d4338 /ext/standard/fsock.c | |
parent | a18000f163f7a5ec618ed1093d5b34b8e8feb631 (diff) | |
download | php-git-5d0c53eecf5e720dd73d14c602a3df9c752e3a67.tar.gz |
Fix some issues with gzFile and fsockopen.
Diffstat (limited to 'ext/standard/fsock.c')
-rw-r--r-- | ext/standard/fsock.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/standard/fsock.c b/ext/standard/fsock.c index 530dcdd21a..e3d3342f27 100644 --- a/ext/standard/fsock.c +++ b/ext/standard/fsock.c @@ -159,7 +159,7 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) ZVAL_STRING(zerrno, "", 1); } - if (port != -1) { /* connect to a host */ + if (port > 0) { /* connect to a host */ enum php_sslflags_t { php_ssl_none, php_ssl_v23, php_ssl_tls }; enum php_sslflags_t ssl_flags; struct { @@ -195,6 +195,11 @@ static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) #endif stream = php_stream_sock_open_host(host, port, socktype, (int)timeout, persistent); + if (stream == NULL) { + zend_error(E_WARNING, "%s(): unable to connect to %s:%d", + get_active_function_name(TSRMLS_C), host, port); + } + #if HAVE_OPENSSL_EXT if (stream) { int ssl_ret = FAILURE; |