X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_request_object.c;h=444516f53c450becab9bbdd728ca3c15c0b8697e;hb=020d5b055921392c0dfb25043962a40867d8b033;hp=7e2544669eea6aa6a99b18c462fd6e0dc1ca91ee;hpb=559c156f3d0aeffe2c920d9275f47cfcdfc40bdf;p=m6w6%2Fext-http diff --git a/http_request_object.c b/http_request_object.c index 7e25446..444516f 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -19,16 +19,10 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif - -#ifdef HTTP_HAVE_CURL -# ifdef PHP_WIN32 -# include -# endif -# include -#endif - #include "php.h" +#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) + #include "php_http_std_defs.h" #include "php_http_request_object.h" #include "php_http_request_api.h" @@ -38,8 +32,10 @@ #include "php_http_message_api.h" #include "php_http_message_object.h" -#ifdef ZEND_ENGINE_2 -#ifdef HTTP_HAVE_CURL +#ifdef PHP_WIN32 +# include +#endif +#include #define http_request_object_declare_default_properties() _http_request_object_declare_default_properties(TSRMLS_C) static inline void _http_request_object_declare_default_properties(TSRMLS_D); @@ -315,11 +311,12 @@ STATUS _http_request_object_responsehandler(http_request_object *obj, zval *this add_assoc_zval(resp, "headers", headers); add_assoc_stringl(resp, "body", body, body_len, 0); - /* XXX */ MAKE_STD_ZVAL(message); - Z_TYPE_P(message) = IS_OBJECT; + message->type = IS_OBJECT; + message->is_ref = 1; message->value.obj = http_message_object_from_msg(msg); SET_PROP(obj, responseMessage, message); + zval_ptr_dtor(&message); http_request_info(obj->ch, Z_ARRVAL_P(info)); SET_PROP(obj, responseInfo, info); @@ -329,8 +326,7 @@ STATUS _http_request_object_responsehandler(http_request_object *obj, zval *this return FAILURE; } -#endif /* HTTP_HAVE_CURL */ -#endif /* ZEND_ENGINE_2 */ +#endif /* ZEND_ENGINE_2 && HTTP_HAVE_CURL */ /* * Local variables: