From: Michael Wallner Date: Thu, 19 Jan 2006 10:34:04 +0000 (+0000) Subject: move (re)setting of request methods to http_request_defaults() X-Git-Tag: RELEASE_0_22_0~29 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=3b81f44e1506fa9356db0b630401f8ff95e9d89a;p=m6w6%2Fext-http move (re)setting of request methods to http_request_defaults() --- diff --git a/http_request_api.c b/http_request_api.c index 1da4e33..9818721 100644 --- a/http_request_api.c +++ b/http_request_api.c @@ -392,6 +392,10 @@ PHP_HTTP_API void _http_request_defaults(http_request *request) HTTP_CURL_OPT(INFILESIZE, 0); HTTP_CURL_OPT(HTTP_VERSION, CURL_HTTP_VERSION_NONE); HTTP_CURL_OPT(CUSTOMREQUEST, NULL); + HTTP_CURL_OPT(NOBODY, 0); + HTTP_CURL_OPT(POST, 0); + HTTP_CURL_OPT(UPLOAD, 0); + HTTP_CURL_OPT(HTTPGET, 1); } } /* }}} */ @@ -643,42 +647,22 @@ 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); HTTP_CURL_OPT(HTTPGET, 1); break; case HTTP_HEAD: - HTTP_CURL_OPT(CUSTOMREQUEST, NULL); - HTTP_CURL_OPT(POST, 0); - HTTP_CURL_OPT(UPLOAD, 0); - HTTP_CURL_OPT(HTTPGET, 0); HTTP_CURL_OPT(NOBODY, 1); break; case HTTP_POST: - HTTP_CURL_OPT(CUSTOMREQUEST, NULL); - HTTP_CURL_OPT(UPLOAD, 0); - HTTP_CURL_OPT(HTTPGET, 0); - HTTP_CURL_OPT(NOBODY, 0); HTTP_CURL_OPT(POST, 1); break; case HTTP_PUT: - HTTP_CURL_OPT(CUSTOMREQUEST, NULL); - HTTP_CURL_OPT(HTTPGET, 0); - HTTP_CURL_OPT(NOBODY, 0); - HTTP_CURL_OPT(POST, 0); HTTP_CURL_OPT(UPLOAD, 1); break; default: - HTTP_CURL_OPT(HTTPGET, 0); - HTTP_CURL_OPT(NOBODY, 0); - HTTP_CURL_OPT(POST, 0); - HTTP_CURL_OPT(UPLOAD, 0); if (http_request_method_exists(0, request->meth, NULL)) { HTTP_CURL_OPT(CUSTOMREQUEST, http_request_method_name(request->meth)); } else {