- don't bail out on allocated but empty request body
authorMichael Wallner <mike@php.net>
Sat, 7 Jan 2006 17:22:58 +0000 (17:22 +0000)
committerMichael Wallner <mike@php.net>
Sat, 7 Jan 2006 17:22:58 +0000 (17:22 +0000)
http_request_api.c
php_http_request_body_api.h

index c35dc911ca3de845ff28409af261fcfcf7fd30aa..84acf1c37b7eb97ac8781e459f82ccc55e2af534 100644 (file)
@@ -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);
index 88d1d0f53c17715bac59928315202b0842b1aed8..5786d6c3b109666ffc1d8d3293013fdc31030848 100644 (file)
@@ -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