- zval **cookie;
- HashPosition pos2;
-
- FOREACH_HASH_VAL(pos2, Z_ARRVAL_PP(header), cookie) {
- zval *cookie_hash;
- MAKE_STD_ZVAL(cookie_hash);
- array_init(cookie_hash);
-
- if (SUCCESS == http_parse_cookie(Z_STRVAL_PP(cookie), Z_ARRVAL_P(cookie_hash))) {
- if (!cookie_len) {
- add_next_index_zval(return_value, cookie_hash);
- } else {
- zval **name;
-
- if ( (SUCCESS == zend_hash_find(Z_ARRVAL_P(cookie_hash), "name", sizeof("name"), (void **) &name)) &&
- (!strcmp(Z_STRVAL_PP(name), cookie_name))) {
- add_next_index_zval(return_value, cookie_hash);
- return; /* <<< FOUND >>> */
- } else {
- zval_dtor(cookie_hash);
- efree(cookie_hash);
- }
- }
- } else {
- zval_dtor(cookie_hash);
- efree(cookie_hash);
+ zval **single_header;
+ HashPosition pos;
+
+ FOREACH_VAL(pos2, *header, single_header) {
+ ZVAL_ADDREF(*single_header);
+ convert_to_string_ex(single_header);
+ if (http_parse_cookie_ex(&list, Z_STRVAL_PP(single_header), flags, allowed_extras)) {
+ zval *cookie;
+
+ MAKE_STD_ZVAL(cookie);
+ object_init(cookie);
+ http_cookie_list_tostruct(&list, cookie);
+ add_next_index_zval(return_value, cookie);
+ http_cookie_list_dtor(&list);