From: Michael Wallner Date: Sat, 7 Jan 2006 17:22:58 +0000 (+0000) Subject: - don't bail out on allocated but empty request body X-Git-Tag: RELEASE_1_0_4~13 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=7071b19ff84a668f6b9273a4dcf762a3cf7565f7;p=m6w6%2Fext-http - don't bail out on allocated but empty request body --- diff --git a/http_request_api.c b/http_request_api.c index c35dc91..84acf1c 100644 --- a/http_request_api.c +++ b/http_request_api.c @@ -658,6 +658,10 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti if (request->body && (request->meth != HTTP_GET) && (request->meth != HTTP_HEAD) && (request->meth != HTTP_OPTIONS)) { switch (request->body->type) { + case HTTP_REQUEST_BODY_EMPTY: + /* nothing */ + break; + case HTTP_REQUEST_BODY_CSTRING: HTTP_CURL_OPT(POSTFIELDS, request->body->data); HTTP_CURL_OPT(POSTFIELDSIZE, request->body->size); diff --git a/php_http_request_body_api.h b/php_http_request_body_api.h index 88d1d0f..5786d6c 100644 --- a/php_http_request_body_api.h +++ b/php_http_request_body_api.h @@ -17,6 +17,7 @@ #ifdef HTTP_HAVE_CURL +#define HTTP_REQUEST_BODY_EMPTY 0 #define HTTP_REQUEST_BODY_CSTRING 1 #define HTTP_REQUEST_BODY_CURLPOST 2 #define HTTP_REQUEST_BODY_UPLOADFILE 3