batch renaming: client*curl curl*client
[m6w6/ext-http] / php_http_headers.c
index a2e59de13f6872a7379389161ebf17cf0022c16e..226c763472253b7ad5cf77daf4d9919a17bc8a34 100644 (file)
@@ -10,9 +10,7 @@
     +--------------------------------------------------------------------+
 */
 
-#include "php_http.h"
-
-#include <Zend/zend_interfaces.h>
+#include "php_http_api.h"
 
 PHP_HTTP_API STATUS php_http_headers_parse(const char *header, size_t length, HashTable *headers, php_http_info_callback_t callback_func, void **callback_data TSRMLS_DC)
 {
@@ -118,7 +116,7 @@ PHP_METHOD(HttpHeader, unserialize)
                                zend_hash_internal_pointer_reset(&ht);
                                switch (zend_hash_get_current_key_ex(&ht, &str, &len, &idx, 0, NULL)) {
                                        case HASH_KEY_IS_STRING:
-                                               zend_update_property_stringl(php_http_header_class_entry, getThis(), ZEND_STRL("name"), str, len TSRMLS_CC);
+                                               zend_update_property_stringl(php_http_header_class_entry, getThis(), ZEND_STRL("name"), str, len - 1 TSRMLS_CC);
                                                break;
                                        case HASH_KEY_IS_LONG:
                                                zend_update_property_long(php_http_header_class_entry, getThis(), ZEND_STRL("name"), idx TSRMLS_CC);
@@ -149,7 +147,8 @@ PHP_METHOD(HttpHeader, match)
        }
 
        zvalue = php_http_ztyp(IS_STRING, zend_read_property(php_http_header_class_entry, getThis(), ZEND_STRL("value"), 0 TSRMLS_CC));
-       RETURN_BOOL(php_http_match(Z_STRVAL_P(zvalue), val_str, flags))
+       RETVAL_BOOL(php_http_match(Z_STRVAL_P(zvalue), val_str, flags));
+       zval_ptr_dtor(&zvalue);
 }
 
 PHP_MINIT_FUNCTION(http_header)