X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_methods.c;h=0f80c6ce21e3441e3772523953ebf1de35ac689b;hp=e4042a11c9b805fcdae5051d74717cf43a653e48;hb=ef65a3f954762e08684b70b5a2e407edfa9c293b;hpb=3e75fa70f5996af755acceab7302e295f99ff670 diff --git a/http_methods.c b/http_methods.c index e4042a1..0f80c6c 100644 --- a/http_methods.c +++ b/http_methods.c @@ -635,9 +635,9 @@ PHP_METHOD(HTTPi_Request, getOptions) PHP_METHOD(HTTPi_Request, unsetOptions) { getObject(httpi_request_object, obj); - + NO_ARGS; - + FREE_PARR(obj, options); INIT_PARR(obj, options); } @@ -651,20 +651,20 @@ PHP_METHOD(HTTPi_Request, addHeader) { zval *opts, **headers, *new_headers; getObject(httpi_request_object, obj); - + if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &new_headers)) { RETURN_FALSE; } - + opts = GET_PROP(obj, options); - + if (SUCCESS == zend_hash_find(Z_ARRVAL_P(opts), "headers", sizeof("headers"), (void **) &headers)) { array_merge(new_headers, *headers); } else { - zval_add_ref(new_headers); + zval_add_ref(&new_headers); add_assoc_zval(opts, "headers", new_headers); } - + RETURN_TRUE; } /* }}} */ @@ -677,20 +677,20 @@ PHP_METHOD(HTTPi_Request, addCookie) { zval *opts, **cookies, *new_cookies; getObject(httpi_request_object, obj); - + if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &new_cookies)) { RETURN_FALSE; } - + opts = GET_PROP(obj, options); - + if (SUCCESS == zend_hash_find(Z_ARRVAL_P(opts), "cookies", sizeof("cookies"), (void **) &cookies)) { array_merge(new_cookies, *cookies); } else { - zval_add_ref(new_cookies); + zval_add_ref(&new_cookies); add_assoc_zval(opts, "cookies", new_cookies); } - + RETURN_TRUE; } /* }}} */