From 890a33b0f67eceab9885db7a2a9f46de0ea961f5 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Fri, 13 Jan 2006 14:30:46 +0000 Subject: [PATCH] - reset CURLOPT_CUSTOMREQUEST at the correct places --- http_request_api.c | 4 ++++ http_request_object.c | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/http_request_api.c b/http_request_api.c index e949bf4..1da4e33 100644 --- a/http_request_api.c +++ b/http_request_api.c @@ -643,6 +643,7 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti switch (request->meth) { case HTTP_GET: + HTTP_CURL_OPT(CUSTOMREQUEST, NULL); HTTP_CURL_OPT(NOBODY, 0); HTTP_CURL_OPT(POST, 0); HTTP_CURL_OPT(UPLOAD, 0); @@ -650,6 +651,7 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti break; case HTTP_HEAD: + HTTP_CURL_OPT(CUSTOMREQUEST, NULL); HTTP_CURL_OPT(POST, 0); HTTP_CURL_OPT(UPLOAD, 0); HTTP_CURL_OPT(HTTPGET, 0); @@ -657,6 +659,7 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti break; case HTTP_POST: + HTTP_CURL_OPT(CUSTOMREQUEST, NULL); HTTP_CURL_OPT(UPLOAD, 0); HTTP_CURL_OPT(HTTPGET, 0); HTTP_CURL_OPT(NOBODY, 0); @@ -664,6 +667,7 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti break; case HTTP_PUT: + HTTP_CURL_OPT(CUSTOMREQUEST, NULL); HTTP_CURL_OPT(HTTPGET, 0); HTTP_CURL_OPT(NOBODY, 0); HTTP_CURL_OPT(POST, 0); diff --git a/http_request_object.c b/http_request_object.c index ead0870..a9bd3bb 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -982,11 +982,6 @@ 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; } -- 2.30.2