- add HttpDeflateStream and HttpInflateStream objects
[m6w6/ext-http] / http_message_object.c
index bd15becf2e3e62747989e1fff4c7640597a2acc2..fa828229b7afd6b6d3b531855674863b35d7ae55 100644 (file)
 #ifdef HAVE_CONFIG_H
 #      include "config.h"
 #endif
-#include "php.h"
+
+#include "php_http.h"
 
 #ifdef ZEND_ENGINE_2
 
-#include "php_http.h"
 #include "php_http_api.h"
-#include "php_http_std_defs.h"
+#include "php_http_message_api.h"
 #include "php_http_message_object.h"
 #include "php_http_exception_object.h"
 
-#include "phpstr/phpstr.h"
-#include "missing.h"
-
 #ifndef WONKY
 #      include "zend_interfaces.h"
 #      if defined(HAVE_SPL)
@@ -37,8 +34,6 @@ extern PHPAPI zend_class_entry *spl_ce_Countable;
 #      endif
 #endif
 
-ZEND_EXTERN_MODULE_GLOBALS(http);
-
 #define HTTP_BEGIN_ARGS(method, ret_ref, req_args)     HTTP_BEGIN_ARGS_EX(HttpMessage, method, ret_ref, req_args)
 #define HTTP_EMPTY_ARGS(method, ret_ref)                       HTTP_EMPTY_ARGS_EX(HttpMessage, method, ret_ref)
 #define HTTP_MESSAGE_ME(method, visibility)                    PHP_ME(HttpMessage, method, HTTP_ARGS(HttpMessage, method), visibility)
@@ -479,7 +474,7 @@ static HashTable *_http_message_object_get_props(zval *object TSRMLS_DC)
                char *m_prop_name; \
                int m_prop_len; \
                zend_mangle_property_name(&m_prop_name, &m_prop_len, "*", 1, name, lenof(name), 0); \
-               add_assoc_ ##ptype## _ex(&array, m_prop_name, sizeof(name)+4, val); \
+               add_assoc_ ##ptype## _ex(&array, m_prop_name, sizeof(name)+3, val); \
                efree(m_prop_name); \
        }
 #define ASSOC_STRING(array, name, val) ASSOC_STRINGL(array, name, val, strlen(val))
@@ -488,7 +483,7 @@ static HashTable *_http_message_object_get_props(zval *object TSRMLS_DC)
                char *m_prop_name; \
                int m_prop_len; \
                zend_mangle_property_name(&m_prop_name, &m_prop_len, "*", 1, name, lenof(name), 0); \
-               add_assoc_stringl_ex(&array, m_prop_name, sizeof(name)+4, val, len, 1); \
+               add_assoc_stringl_ex(&array, m_prop_name, sizeof(name)+3, val, len, 1); \
                efree(m_prop_name); \
        }
 
@@ -554,7 +549,7 @@ PHP_METHOD(HttpMessage, __construct)
                http_message *msg = obj->message;
                
                http_message_dtor(msg);
-               if (obj->message = http_message_parse_ex(msg, message, length)) {
+               if ((obj->message = http_message_parse_ex(msg, message, length))) {
                        if (obj->message->parent) {
                                obj->parent = http_message_object_new_ex(Z_OBJCE_P(getThis()), obj->message->parent, NULL);
                        }
@@ -590,7 +585,7 @@ PHP_METHOD(HttpMessage, fromString)
        
        SET_EH_THROW_HTTP();
        if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &string, &length)) {
-               if (msg = http_message_parse(string, length)) {
+               if ((msg = http_message_parse(string, length))) {
                        ZVAL_OBJVAL(return_value, http_message_object_new_ex(http_message_object_ce, msg, NULL));
                }
        }