- reset CURLOPT_CUSTOMREQUEST at the correct places
authorMichael Wallner <mike@php.net>
Fri, 13 Jan 2006 14:30:46 +0000 (14:30 +0000)
committerMichael Wallner <mike@php.net>
Fri, 13 Jan 2006 14:30:46 +0000 (14:30 +0000)
http_request_api.c
http_request_object.c

index e949bf45beadefa93082e987d37f8b0687edf3e0..1da4e332b9ff4063b160c4bff23aa9d16d8d39a8 100644 (file)
@@ -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);
index ead0870361dd25e9e278f7a0d658548a3d13c5c7..a9bd3bb12c3a436c92efb4275f4c8f93525dd276 100644 (file)
@@ -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;
 }