From: Ilia Alshanetsky Date: Thu, 26 Feb 2004 00:02:27 +0000 (+0000) Subject: Handle situation where feof() occurs before the HTTP header is retrieved. X-Git-Tag: RELEASE_0_2_0~154 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f5f7c6dd0a2c59a861880b4afda60ba2afb7660;p=php Handle situation where feof() occurs before the HTTP header is retrieved. --- diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index d328311b11..244ffa1b6f 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -399,6 +399,9 @@ php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper, char *path, Z_TYPE_P(http_response) = IS_STRING; zend_hash_next_index_insert(Z_ARRVAL_PP(response_header), &http_response, sizeof(zval *), NULL); } + } else { + php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "HTTP request failed, unexpected end of socket.!"); + goto out; } /* read past HTTP headers */