From: Ilia Alshanetsky Date: Fri, 13 Jan 2006 02:57:21 +0000 (+0000) Subject: Don't forget to reset CUSTOMREQUEST on method change and defaults restore. X-Git-Tag: RELEASE_1_0_4~2 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=c5eec6611ed1dd1e9e984deb007bc11c92784451;p=m6w6%2Fext-http Don't forget to reset CUSTOMREQUEST on method change and defaults restore. --- diff --git a/http_request_api.c b/http_request_api.c index 8c11249..e949bf4 100644 --- a/http_request_api.c +++ b/http_request_api.c @@ -391,6 +391,7 @@ PHP_HTTP_API void _http_request_defaults(http_request *request) HTTP_CURL_OPT(READDATA, NULL); HTTP_CURL_OPT(INFILESIZE, 0); HTTP_CURL_OPT(HTTP_VERSION, CURL_HTTP_VERSION_NONE); + HTTP_CURL_OPT(CUSTOMREQUEST, NULL); } } /* }}} */ diff --git a/http_request_object.c b/http_request_object.c index a9bd3bb..ead0870 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -982,6 +982,11 @@ PHP_METHOD(HttpRequest, setMethod) RETURN_FALSE; } + if (meth >= HTTP_GET && meth <= HTTP_PUT) { + getObject(http_request_object, obj); + curl_easy_setopt(obj->request->ch, CURLOPT_CUSTOMREQUEST, NULL); + } + UPD_PROP(long, method, meth); RETURN_TRUE; }