X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_request_object.c;h=09d7822d90b0124855b1f02e2a221452eff532b3;hp=f9bbf5e018451225b350145b4cf89796a965bd7b;hb=60ec6f16e06d6666aaf4d4fec36fd53e2e504a0c;hpb=ef504c97eb98ff93e63d32452aca0684ed3c514a diff --git a/http_request_object.c b/http_request_object.c index f9bbf5e..09d7822 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -549,12 +549,16 @@ static inline void _http_request_object_check_request_content_type(zval *this_pt STATUS _http_request_object_requesthandler(http_request_object *obj, zval *this_ptr TSRMLS_DC) { STATUS status = SUCCESS; + char *url = http_absolute_url(Z_STRVAL_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("url")-1, 0 TSRMLS_CC))); + if (!url) { + return FAILURE; + } + http_request_reset(obj->request); + obj->request->url = url; HTTP_CHECK_CURL_INIT(obj->request->ch, http_curl_init(obj->request), return FAILURE); - obj->request->url = http_absolute_url(Z_STRVAL_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("url")-1, 0 TSRMLS_CC))); - switch (obj->request->meth = Z_LVAL_P(zend_read_property(THIS_CE, getThis(), ZEND_STRS("method")-1, 0 TSRMLS_CC))) { case HTTP_GET: @@ -633,7 +637,7 @@ STATUS _http_request_object_requesthandler(http_request_object *obj, zval *this_ if ( (Z_TYPE_P(options) != IS_ARRAY) || (SUCCESS != zend_hash_find(Z_ARRVAL_P(options), "onprogress", sizeof("onprogress"), (void *) &entry) - || (!zend_is_callable(*entry, 0, NULL)))) { + || (!IS_CALLABLE(*entry, 0, NULL)))) { MAKE_STD_ZVAL(pcb); array_init(pcb); ZVAL_ADDREF(getThis()); @@ -777,7 +781,7 @@ static inline void _http_request_object_set_options_subr(INTERNAL_FUNCTION_PARAM } } else if (opts) { if (prettify_keys) { - zend_hash_apply_with_arguments(Z_ARRVAL_P(opts), apply_pretty_key, 0); + zend_hash_apply_with_arguments(Z_ARRVAL_P(opts), apply_pretty_key, 0, NULL); } ZVAL_ADDREF(opts); add_assoc_zval_ex(new_opts, key, len, opts);