From dac9fc69ba6208b3a150ad447c0ede3b786a83c5 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Fri, 10 Jun 2005 12:54:44 +0000 Subject: [PATCH] - ditch redundant http_split_response - missing include - old libcurl on snaps revealed a "left-over" --- http_api.c | 16 +++------------- http_functions.c | 2 +- http_request_api.c | 2 +- php_http_api.h | 6 ++---- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/http_api.c b/http_api.c index 9c587c8..48e3c31 100644 --- a/http_api.c +++ b/http_api.c @@ -22,6 +22,7 @@ #include #include "php.h" +#include "ext/standard/url.h" #include "php_http.h" #include "php_http_std_defs.h" @@ -108,7 +109,7 @@ STATUS _http_parse_key_list(const char *list, HashTable *items, char separator, } HTTP_KEYLIST_FIXKEY(); - + if (first_entry_is_name_value_pair) { HTTP_KEYLIST_VAL(&array, "name", key, keylen); @@ -285,19 +286,8 @@ PHP_HTTP_API const char *_http_chunked_decode(const char *encoded, size_t encode } /* }}} */ -/* {{{ STATUS http_split_response(zval *, zval *, zval *) */ -PHP_HTTP_API STATUS _http_split_response(zval *response, zval *headers, zval *body TSRMLS_DC) -{ - char *b = NULL; - size_t l = 0; - STATUS status = http_split_response_ex(Z_STRVAL_P(response), Z_STRLEN_P(response), Z_ARRVAL_P(headers), &b, &l); - ZVAL_STRINGL(body, b, l, 0); - return status; -} -/* }}} */ - /* {{{ STATUS http_split_response(char *, size_t, HashTable *, char **, size_t *) */ -PHP_HTTP_API STATUS _http_split_response_ex(char *response, size_t response_len, +PHP_HTTP_API STATUS _http_split_response(char *response, size_t response_len, HashTable *headers, char **body, size_t *body_len TSRMLS_DC) { char *header = response, *real_body = NULL; diff --git a/http_functions.c b/http_functions.c index 9f76881..01df1a1 100644 --- a/http_functions.c +++ b/http_functions.c @@ -618,7 +618,7 @@ PHP_FUNCTION(http_split_response) MAKE_STD_ZVAL(zheaders); array_init(zheaders); - if (SUCCESS != http_split_response(zresponse, zheaders, zbody)) { + if (SUCCESS != http_split_response(Z_STRVAL_P(zresponse), Z_STRLEN_P(zresponse), Z_ARRVAL_P(zheaders), &Z_STRVAL_P(zbody), &Z_STRLEN_P(zbody))) { http_error(E_WARNING, HTTP_E_PARSE, "Could not parse HTTP response"); RETURN_FALSE; } diff --git a/http_request_api.c b/http_request_api.c index 3644f9d..6eb31fb 100644 --- a/http_request_api.c +++ b/http_request_api.c @@ -47,7 +47,7 @@ ZEND_EXTERN_MODULE_GLOBALS(http) #if LIBCURL_VERSION_NUM < 0x070c00 -# define curl_easy_strerror(code) HTTP_G(request).curl.error +# define curl_easy_strerror(code) HTTP_G(request).error #endif #define HTTP_CURL_INFO(I) HTTP_CURL_INFO_EX(I, I) diff --git a/php_http_api.h b/php_http_api.h index a68b5b7..1924f96 100644 --- a/php_http_api.h +++ b/php_http_api.h @@ -56,10 +56,8 @@ PHP_HTTP_API zval *_http_get_server_var_ex(const char *key, size_t key_size, zen #define http_chunked_decode(e, el, d, dl) _http_chunked_decode((e), (el), (d), (dl) TSRMLS_CC) PHP_HTTP_API const char *_http_chunked_decode(const char *encoded, size_t encoded_len, char **decoded, size_t *decoded_len TSRMLS_DC); -#define http_split_response(r, h, b) _http_split_response((r), (h), (b) TSRMLS_CC) -PHP_HTTP_API STATUS _http_split_response(zval *response, zval *headers, zval *body TSRMLS_DC); -#define http_split_response_ex(r, rl, h, b, bl) _http_split_response_ex((r), (rl), (h), (b), (bl) TSRMLS_CC) -PHP_HTTP_API STATUS _http_split_response_ex(char *response, size_t repsonse_len, HashTable *headers, char **body, size_t *body_len TSRMLS_DC); +#define http_split_response(r, rl, h, b, bl) _http_split_response((r), (rl), (h), (b), (bl) TSRMLS_CC) +PHP_HTTP_API STATUS _http_split_response(char *response, size_t repsonse_len, HashTable *headers, char **body, size_t *body_len TSRMLS_DC); #endif -- 2.30.2