- include missing.h in http.c for static property fixup
authorMichael Wallner <mike@php.net>
Wed, 24 Aug 2005 10:53:51 +0000 (10:53 +0000)
committerMichael Wallner <mike@php.net>
Wed, 24 Aug 2005 10:53:51 +0000 (10:53 +0000)
- don't free the http message in http_message_tostruct_recursive() but where it was allocated
- use the "standard" way in RETVAL_OBJVAL()

KnownIssues.txt
http.c
http_functions.c
http_message_api.c
http_message_object.c
php_http_info_api.h
php_http_std_defs.h

index 0a9dc3fd5c1cccecf6ea087211946486697bcebb..dfe8c82e684dab7529dff9b75d9edc5bbc5b48f5 100644 (file)
@@ -4,3 +4,6 @@ $Id$
 
 HttpResponse class is infunctional with current ZendEngine2,
 a fix is pending.
+
+http_chunked_decode() still depends on CRLF.
+
diff --git a/http.c b/http.c
index 444341e634a03e3e10480a302cd89aa813606a7f..990c008873ec6b7596dac373ab9c3abc35b5dbf7 100644 (file)
--- a/http.c
+++ b/http.c
@@ -44,6 +44,7 @@
 #      include "php_http_exception_object.h"
 #endif
 
+#include "missing.h"
 #include "phpstr/phpstr.h"
 
 #ifdef HTTP_HAVE_CURL
index ced4e81b5f18490062cc04c17b075463ba8bccb6..2bcdd212725188791493e1cccaa081844f05ba5e 100644 (file)
@@ -679,6 +679,7 @@ PHP_FUNCTION(http_parse_message)
        if (msg = http_message_parse(message, message_len)) {
                object_init(return_value);
                http_message_tostruct_recursive(msg, return_value);
+               http_message_free(&msg);
        } else {
                RETURN_NULL();
        }
index 5a2bdb763670023e5769d16f838bd598822964d0..76a557bb7e38ab22fa8076c6f61cc57933a57c1b 100644 (file)
@@ -353,8 +353,6 @@ PHP_HTTP_API void _http_message_tostruct_recursive(http_message *msg, zval *obj
        } else {
                add_assoc_null(&strct, "parentMessage");
        }
-       http_message_dtor(msg);
-       efree(msg);
 }
 
 PHP_HTTP_API STATUS _http_message_send(http_message *message TSRMLS_DC)
index 108848be08df66a9278158d5dea7e0c46b41634a..71c06d5f108b0dd8fa133890c2402449053e25a0 100644 (file)
@@ -776,7 +776,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);
index cd229ed93bd16ab838957eea247726cbd5178788..9dd64c84b384b5a86a6c6a60ce038140eaece4a6 100644 (file)
@@ -56,7 +56,7 @@ PHP_HTTP_API void _http_info_default_callback(void **nothing, HashTable **header
 PHP_HTTP_API void _http_info_dtor(http_info *info);
 #define http_info_parse(p, i) _http_info_parse_ex((p), (i), 1 TSRMLS_CC)
 #define http_info_parse_ex(p, i, s) _http_info_parse_ex((p), (i), (s) TSRMLS_CC)
-PHP_HTTP_API STATUS _http__infoparse_ex(const char *pre_header, http_info *info , zend_bool silent TSRMLS_DC);
+PHP_HTTP_API STATUS _http_info_parse_ex(const char *pre_header, http_info *info , zend_bool silent TSRMLS_DC);
 
 #endif
 
index 8bef4f88e7a3aa390621e103c53d6106aad2dfbc..763a8cf0b3c11255dabfc0be2987fc5c352ba18e 100644 (file)
@@ -65,7 +65,9 @@ typedef int STATUS;
        return_value->is_ref = 1; \
        return_value->type = IS_OBJECT; \
        return_value->value.obj = (ov); \
-       zend_objects_store_add_ref(return_value TSRMLS_CC)
+       if (Z_OBJ_HT_P(return_value)) { \
+               Z_OBJ_HT_P(return_value)->add_ref(return_value TSRMLS_CC); \
+       }
 #define RETURN_OBJVAL(ov) \
        RETVAL_OBJVAL(ov); \
        return