From: Michael Wallner Date: Sat, 7 Jan 2006 17:02:27 +0000 (+0000) Subject: - create a request body only if there's something to feed into http_request_body_fill() X-Git-Tag: RELEASE_1_0_4~15 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=5aa958980652d72433ba8e9e500b8dfd123d56a1;p=m6w6%2Fext-http - create a request body only if there's something to feed into http_request_body_fill() --- diff --git a/http_request_object.c b/http_request_object.c index c8fe26d..ad6e432 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -503,8 +503,10 @@ STATUS _http_request_object_requesthandler(http_request_object *obj, zval *this_ fields = (Z_TYPE_P(zfields) == IS_ARRAY) ? Z_ARRVAL_P(zfields) : NULL; files = (Z_TYPE_P(zfiles) == IS_ARRAY) ? Z_ARRVAL_P(zfiles) : NULL; - if (!(obj->request->body = http_request_body_fill(obj->request->body, fields, files))) { - status = FAILURE; + if ((fields && zend_hash_num_elements(fields)) || (files && zend_hash_num_elements(files))) { + if (!(obj->request->body = http_request_body_fill(obj->request->body, fields, files))) { + status = FAILURE; + } } } }