fixup php_http_params
[m6w6/ext-http] / php_http_env_response.c
index f9e8c4cb43ce7045679a3963810e5ac06270df9c..c8a31e070bd0b1b38fddbb60aadfe841738c9bf3 100644 (file)
@@ -119,6 +119,7 @@ static void set_cookie(zval *options, zval *zcookie_new TSRMLS_DC)
                }
                array_init_size(zcookies_set, zend_hash_num_elements(&obj->list->cookies));
        } else {
+               Z_ADDREF_P(zcookies_set);
                SEPARATE_ZVAL(zcookies_set);
        }
 
@@ -465,7 +466,6 @@ static ZEND_RESULT_CODE php_http_env_response_send_head(php_http_env_response_t
                                zval *tmp = zoption;
                                SEPARATE_ZVAL(tmp);
                                convert_to_array(tmp);
-                               zval_ptr_dtor(zoption);
                                zoption = tmp;
                        }
 
@@ -502,7 +502,7 @@ static ZEND_RESULT_CODE php_http_env_response_send_head(php_http_env_response_t
                                                zend_ulong index = 0;
 
                                                zend_hash_internal_pointer_reset(result);
-                                               if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(result, &key_str, &index, NULL)) {
+                                               if (HASH_KEY_IS_STRING == zend_hash_get_current_key(result, &key_str, &index)) {
                                                        if (zend_string_equals_literal(key_str, "gzip")) {
                                                                if (!(r->content.encoder = php_http_encoding_stream_init(NULL, php_http_encoding_stream_get_deflate_ops(), PHP_HTTP_DEFLATE_TYPE_GZIP))) {
                                                                        ret = FAILURE;