X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_functions.c;h=61fa5196ecae57bb4ad1812375a72dfba8f690b3;hp=5854e30b86d1c0d4d824def146f716a4290e7762;hb=935edd6c43530eb35c79d8ec8e0920f7d07f5f62;hpb=e434da0fad7db62d86c236c68b22150165f2647a diff --git a/http_functions.c b/http_functions.c index 5854e30..61fa519 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; @@ -674,6 +670,7 @@ PHP_FUNCTION(http_get_request_headers) * - lastmodified: int, timestamp for If-(Un)Modified-Since header * - timeout: int, seconds the request may take * - connecttimeout: int, seconds the connect may take + * - onprogress: mixed, progress callback * * * The optional third parameter will be filled with some additional information @@ -984,6 +981,7 @@ PHP_FUNCTION(http_build_query) PHP_FUNCTION(http_test) { + RETURN_NULL(); } /*