X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_request_object.c;h=761e9ca4fda6bc9c280118dfaf2e508ef848d0b0;hp=e744a227ede89642442302d35629d9dcf856d90a;hb=2190567a9216095798e0268f9d61eb5ec920790e;hpb=e9bf638297f2addf61884f46f6a648a42d0bf39e diff --git a/http_request_object.c b/http_request_object.c index e744a22..761e9ca 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -390,7 +390,9 @@ void _http_request_object_free(zend_object *object TSRMLS_DC) if (o->ch) { /* avoid nasty segfaults with already cleaned up callbacks */ curl_easy_setopt(o->ch, CURLOPT_NOPROGRESS, 1); + curl_easy_setopt(o->ch, CURLOPT_PROGRESSFUNCTION, NULL); curl_easy_setopt(o->ch, CURLOPT_VERBOSE, 0); + curl_easy_setopt(o->ch, CURLOPT_DEBUGFUNCTION, NULL); curl_easy_cleanup(o->ch); } phpstr_dtor(&o->response); @@ -648,30 +650,33 @@ PHP_METHOD(HttpRequest, setOptions) zval **headers; if (SUCCESS == zend_hash_find(Z_ARRVAL_P(old_opts), "headers", sizeof("headers"), (void **) &headers)) { array_merge(*opt, *headers); + continue; } } else if (!strcmp(key, "cookies")) { zval **cookies; if (SUCCESS == zend_hash_find(Z_ARRVAL_P(old_opts), "cookies", sizeof("cookies"), (void **) &cookies)) { array_merge(*opt, *cookies); + continue; } } else if ((!strcasecmp(key, "url")) || (!strcasecmp(key, "uri"))) { if (Z_TYPE_PP(opt) != IS_STRING) { convert_to_string_ex(opt); } UPD_PROP(obj, string, url, Z_STRVAL_PP(opt)); + continue; } else if (!strcmp(key, "method")) { if (Z_TYPE_PP(opt) != IS_LONG) { convert_to_long_ex(opt); } UPD_PROP(obj, long, method, Z_LVAL_PP(opt)); - } else { - if (!strcmp(key, "ondebug")) { - SET_PROP(obj, dbg_user_cb, *opt); - } - zval_add_ref(opt); - add_assoc_zval(old_opts, key, *opt); + continue; + } else if (!strcmp(key, "ondebug")) { + SET_PROP(obj, dbg_user_cb, *opt); } + zval_add_ref(opt); + add_assoc_zval(old_opts, key, *opt); + /* reset */ key = NULL; }