From 7071b19ff84a668f6b9273a4dcf762a3cf7565f7 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Sat, 7 Jan 2006 17:22:58 +0000 Subject: [PATCH] - don't bail out on allocated but empty request body --- http_request_api.c | 4 ++++ php_http_request_body_api.h | 1 + 2 files changed, 5 insertions(+) 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 -- 2.30.2