X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_request.c;h=ea4d4dd39de76b5108c8e118cebae5fc56c82e7e;hp=7320856b5390f980cf405a2eb438fb33d5f51865;hb=aacbe6aa75ca07853bf88d5b3647f67f107d1af7;hpb=4062420a5e5d301db4a3d820be881e7675a242e1 diff --git a/php_http_request.c b/php_http_request.c index 7320856..ea4d4dd 100644 --- a/php_http_request.c +++ b/php_http_request.c @@ -6,18 +6,13 @@ | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ - | Copyright (c) 2004-2010, Michael Wallner | + | Copyright (c) 2004-2011, Michael Wallner | +--------------------------------------------------------------------+ */ -/* $Id: php_http_request_api.c 298591 2010-04-26 11:46:55Z mike $ */ - -#include "php_http.h" +#include "php_http_api.h" #include -#include -#include - PHP_HTTP_API php_http_request_t *php_http_request_init(php_http_request_t *h, php_http_request_ops_t *ops, php_http_resource_factory_t *rf, void *init_arg TSRMLS_DC) { @@ -549,6 +544,7 @@ STATUS php_http_request_object_responsehandler(php_http_request_object_t *obj, z static int apply_pretty_key(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) { if (hash_key->arKey && hash_key->nKeyLength > 1) { + /* FIXME: this seems evil */ hash_key->h = zend_hash_func(php_http_pretty_key(hash_key->arKey, hash_key->nKeyLength - 1, 1, 0), hash_key->nKeyLength); } return ZEND_HASH_APPLY_KEEP; @@ -1119,7 +1115,7 @@ PHP_METHOD(HttpRequest, getResponseCookies) FOREACH_VAL(pos2, *header, single_header) { zval *data = php_http_ztyp(IS_STRING, *single_header); - if ((list = php_http_cookie_list_parse(NULL, Z_STRVAL_P(data), flags, allowed_extras TSRMLS_CC))) { + if ((list = php_http_cookie_list_parse(NULL, Z_STRVAL_P(data), Z_STRLEN_P(data), flags, allowed_extras TSRMLS_CC))) { zval *cookie; MAKE_STD_ZVAL(cookie); @@ -1130,7 +1126,7 @@ PHP_METHOD(HttpRequest, getResponseCookies) } } else { zval *data = php_http_ztyp(IS_STRING, *header); - if ((list = php_http_cookie_list_parse(NULL, Z_STRVAL_P(data), flags, allowed_extras TSRMLS_CC))) { + if ((list = php_http_cookie_list_parse(NULL, Z_STRVAL_P(data), Z_STRLEN_P(data), flags, allowed_extras TSRMLS_CC))) { zval *cookie; MAKE_STD_ZVAL(cookie);