X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_functions.c;h=9bf3399d72570ba6b6eb3a4abf1caf0eeb0ff9fd;hp=5854e30b86d1c0d4d824def146f716a4290e7762;hb=c2b4f0332ead5425b183d2487ab5f25663f1009f;hpb=456dd6f5e057a0fc4ff3dbaf006d71cf5c247f19 diff --git a/http_functions.c b/http_functions.c index 5854e30..9bf3399 100644 --- a/http_functions.c +++ b/http_functions.c @@ -549,7 +549,7 @@ PHP_FUNCTION(http_chunked_decode) RETURN_FALSE; } - if (SUCCESS == http_chunked_decode(encoded, encoded_len, &decoded, &decoded_len)) { + if (NULL != http_chunked_decode(encoded, encoded_len, &decoded, &decoded_len)) { RETURN_STRINGL(decoded, decoded_len, 0); } else { RETURN_FALSE; @@ -566,7 +566,7 @@ PHP_FUNCTION(http_chunked_decode) * array( - * 'Status' => '200 Ok', + * 'Response Status' => '200 Ok', * 'Content-Type' => 'text/plain', * 'Content-Language' => 'en-US' * ), @@ -605,7 +605,7 @@ PHP_FUNCTION(http_split_response) */ PHP_FUNCTION(http_parse_headers) { - char *header, *rnrn; + char *header; int header_len; if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &header, &header_len)) { @@ -613,11 +613,7 @@ PHP_FUNCTION(http_parse_headers) } array_init(return_value); - - if (rnrn = strstr(header, HTTP_CRLF HTTP_CRLF)) { - header_len = rnrn - header + 2; - } - if (SUCCESS != http_parse_headers(header, header_len, return_value)) { + if (SUCCESS != http_parse_headers(header, return_value)) { http_error(E_WARNING, HTTP_E_PARSE, "Could not parse HTTP headers"); zval_dtor(return_value); RETURN_FALSE; @@ -984,6 +980,7 @@ PHP_FUNCTION(http_build_query) PHP_FUNCTION(http_test) { + RETURN_NULL(); } /*