X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_request_object.c;h=e6ed74ae0aaafd0dd2e876e746296e8322bdc08e;hb=c64365b84429b86b4af55b283de3758af38d9369;hp=ead0870361dd25e9e278f7a0d658548a3d13c5c7;hpb=c5eec6611ed1dd1e9e984deb007bc11c92784451;p=m6w6%2Fext-http diff --git a/http_request_object.c b/http_request_object.c index ead0870..e6ed74a 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -12,10 +12,6 @@ /* $Id$ */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - #define HTTP_WANT_CURL #include "php_http.h" @@ -607,7 +603,7 @@ STATUS _http_request_object_responsehandler(http_request_object *obj, zval *this zval_ptr_dtor(&resp); MAKE_STD_ZVAL(message); - ZVAL_OBJVAL(message, http_message_object_new_ex(http_message_object_ce, msg, NULL)); + ZVAL_OBJVAL(message, http_message_object_new_ex(http_message_object_ce, msg, NULL), 0); SET_PROP(responseMessage, message); zval_ptr_dtor(&message); @@ -982,11 +978,6 @@ PHP_METHOD(HttpRequest, setMethod) RETURN_FALSE; } - if (meth >= HTTP_GET && meth <= HTTP_PUT) { - getObject(http_request_object, obj); - curl_easy_setopt(obj->request->ch, CURLOPT_CUSTOMREQUEST, NULL); - } - UPD_PROP(long, method, meth); RETURN_TRUE; } @@ -1722,7 +1713,7 @@ PHP_METHOD(HttpRequest, getResponseMessage) SET_EH_THROW_HTTP(); message = GET_PROP(responseMessage); if (Z_TYPE_P(message) == IS_OBJECT) { - RETVAL_OBJECT(message); + RETVAL_OBJECT(message, 1); } else { RETVAL_NULL(); } @@ -1759,7 +1750,7 @@ PHP_METHOD(HttpRequest, getRequestMessage) SET_EH_THROW_HTTP(); if ((msg = http_message_parse(PHPSTR_VAL(&obj->request->conv.request), PHPSTR_LEN(&obj->request->conv.request)))) { - ZVAL_OBJVAL(return_value, http_message_object_new_ex(http_message_object_ce, msg, NULL)); + RETVAL_OBJVAL(http_message_object_new_ex(http_message_object_ce, msg, NULL), 0); } SET_EH_NORMAL(); } @@ -1833,7 +1824,7 @@ PHP_METHOD(HttpRequest, getHistory) SET_EH_THROW_HTTP(); if ((msg = http_message_parse(PHPSTR_VAL(&obj->history), PHPSTR_LEN(&obj->history)))) { - ZVAL_OBJVAL(return_value, http_message_object_new_ex(http_message_object_ce, msg, NULL)); + RETVAL_OBJVAL(http_message_object_new_ex(http_message_object_ce, msg, NULL), 0); } SET_EH_NORMAL(); } @@ -1913,7 +1904,7 @@ PHP_METHOD(HttpRequest, send) } else if (SUCCESS == http_request_object_requesthandler(obj, getThis())) { http_request_exec(obj->request); if (SUCCESS == http_request_object_responsehandler(obj, getThis())) { - RETVAL_OBJECT(GET_PROP(responseMessage)); + RETVAL_OBJECT(GET_PROP(responseMessage), 1); } }