From cdfa5298b064787eebbdce77a46b5ae77b3617ae Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Thu, 1 Mar 2012 21:42:01 +0000 Subject: [PATCH] fix tests; fix leaks in new http\Env\Request methods; release dev6 --- package.xml | 15 ++++++++------- php_http_env_request.c | 3 +++ tests/message002.phpt | 27 +++++++++++++++++++++++++-- tests/response002.phpt | 2 +- 4 files changed, 37 insertions(+), 10 deletions(-) diff --git a/package.xml b/package.xml index 2e2dec0..e91e84a 100644 --- a/package.xml +++ b/package.xml @@ -27,9 +27,9 @@ Extended HTTP support. Again. Keep in mind that it's got the major version 2, be mike@php.net yes - 2012-02-17 + 2012-03-01 - 2.0.0dev5 + 2.0.0dev6 2.0.0 @@ -38,11 +38,10 @@ Extended HTTP support. Again. Keep in mind that it's got the major version 2, be BSD, revised @@ -65,6 +64,8 @@ Extended HTTP support. Again. Keep in mind that it's got the major version 2, be + + diff --git a/php_http_env_request.c b/php_http_env_request.c index c11f730..4313370 100644 --- a/php_http_env_request.c +++ b/php_http_env_request.c @@ -134,6 +134,7 @@ PHP_METHOD(HttpEnvRequest, __construct) if (SUCCESS == php_http_querystring_ctor(zquery, zsg TSRMLS_CC)) { zend_update_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("query"), zquery TSRMLS_CC); } + zval_ptr_dtor(&zquery); } if ((zsg = php_http_env_get_superglobal(ZEND_STRL("_POST") TSRMLS_CC))) { zval *zpost; @@ -143,6 +144,7 @@ PHP_METHOD(HttpEnvRequest, __construct) if (SUCCESS == php_http_querystring_ctor(zpost, zsg TSRMLS_CC)) { zend_update_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("post"), zpost TSRMLS_CC); } + zval_ptr_dtor(&zpost); } if ((zsg = php_http_env_get_superglobal(ZEND_STRL("_FILES") TSRMLS_CC))) { zval *zfiles; @@ -152,6 +154,7 @@ PHP_METHOD(HttpEnvRequest, __construct) zend_hash_apply_with_arguments(Z_ARRVAL_P(zsg) TSRMLS_CC, grab_files, 1, zfiles); zend_update_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("files"), zfiles TSRMLS_CC); + zval_ptr_dtor(&zfiles); } } } end_error_handling(); diff --git a/tests/message002.phpt b/tests/message002.phpt index a76e9e5..bb19875 100644 --- a/tests/message002.phpt +++ b/tests/message002.phpt @@ -25,7 +25,7 @@ var_dump((string)$m->getBody()); echo "Done\n"; --EXPECTF-- Test -object(%s)#%d (10) { +object(%s)#%d (13) { ["errorHandling":protected]=> NULL ["type":protected]=> @@ -46,7 +46,11 @@ object(%s)#%d (10) { ["httpVersion":protected]=> string(3) "1.1" ["headers":protected]=> - array(2) { + array(4) { + ["Content-Type"]=> + string(14) "test/something" + ["Content-Length"]=> + string(1) "3" ["X-Test"]=> string(4) "test" ["Cookie"]=> @@ -54,6 +58,25 @@ object(%s)#%d (10) { } ["parentMessage":protected]=> NULL + ["query":protected]=> + object(http\QueryString)#2 (2) { + ["errorHandling":protected]=> + NULL + ["queryArray":"http\QueryString":private]=> + array(0) { + } + } + ["post":protected]=> + object(http\QueryString)#3 (2) { + ["errorHandling":protected]=> + NULL + ["queryArray":"http\QueryString":private]=> + array(0) { + } + } + ["files":protected]=> + array(0) { + } } POST / HTTP/1.1%a X-Test: test%a diff --git a/tests/response002.phpt b/tests/response002.phpt index 0a815ad..9a2d3da 100644 --- a/tests/response002.phpt +++ b/tests/response002.phpt @@ -2,7 +2,7 @@ http response cache negative --SKIPIF-- ---POST-- +--GET-- a=b --ENV-- HTTP_IF_MODIFIED_SINCE=Fri, 13 Feb 2009 23:31:30 GMT -- 2.30.2