- add missing support for raw post data (HttpRequest)
[m6w6/ext-http] / http_message_object.c
index 108848be08df66a9278158d5dea7e0c46b41634a..51e2ca21831261083f6bc6a1c30c8c609640a5ca 100644 (file)
@@ -123,7 +123,8 @@ zend_function_entry http_message_object_fe[] = {
        ZEND_MALIAS(HttpMessage, __toString, toString, HTTP_ARGS(HttpMessage, toString), ZEND_ACC_PUBLIC)
 
        HTTP_MESSAGE_ME(fromString, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
-       {NULL, NULL, NULL}
+       
+       EMPTY_FUNCTION_ENTRY
 };
 static zend_object_handlers http_message_object_handlers;
 
@@ -183,9 +184,11 @@ static inline void _http_message_object_declare_default_properties(TSRMLS_D)
 {
        zend_class_entry *ce = http_message_object_ce;
 
+#ifndef WONKY
        DCL_CONST(long, "NONE", HTTP_MSG_NONE);
        DCL_CONST(long, "REQUEST", HTTP_MSG_REQUEST);
        DCL_CONST(long, "RESPONSE", HTTP_MSG_RESPONSE);
+#endif
 
        DCL_PROP(PROTECTED, long, type, HTTP_MSG_NONE);
        DCL_PROP(PROTECTED, string, body, "");
@@ -232,7 +235,7 @@ static zval *_http_message_object_read_prop(zval *object, zval *member, int type
        fprintf(stderr, "Read HttpMessage::$%s\n", Z_STRVAL_P(member));
 #endif
        if (!EG(scope) || !instanceof_function(EG(scope), obj->zo.ce TSRMLS_CC)) {
-               zend_error(HE_WARNING, "Cannot access protected property %s::$%s", obj->zo.ce->name, Z_STRVAL_P(member));
+               zend_error(E_WARNING, "Cannot access protected property %s::$%s", obj->zo.ce->name, Z_STRVAL_P(member));
                return EG(uninitialized_zval_ptr);
        }
 
@@ -323,7 +326,7 @@ static void _http_message_object_write_prop(zval *object, zval *member, zval *va
        fprintf(stderr, "Write HttpMessage::$%s\n", Z_STRVAL_P(member));
 #endif
        if (!EG(scope) || !instanceof_function(EG(scope), obj->zo.ce TSRMLS_CC)) {
-               zend_error(HE_WARNING, "Cannot access protected property %s::$%s", obj->zo.ce->name, Z_STRVAL_P(member));
+               zend_error(E_WARNING, "Cannot access protected property %s::$%s", obj->zo.ce->name, Z_STRVAL_P(member));
        }
 
        switch (zend_get_hash_value(Z_STRVAL_P(member), Z_STRLEN_P(member) + 1))
@@ -776,7 +779,6 @@ PHP_METHOD(HttpMessage, getHttpVersion)
 
        IF_RETVAL_USED {
                char ver[4] = {0};
-               double version;
                getObject(http_message_object, obj);
 
                sprintf(ver, "%1.1lf", obj->message->http.version);