From 4062420a5e5d301db4a3d820be881e7675a242e1 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Thu, 28 Jul 2011 11:11:40 +0000 Subject: [PATCH] use zend_symtable where appropriate --- php_http_cookie.c | 24 ++++++++++++------------ php_http_cookie.h | 4 ++-- php_http_env.c | 10 +++++----- php_http_env_response.c | 2 +- php_http_header_parser.c | 2 +- php_http_message.c | 8 ++++---- php_http_misc.c | 2 +- php_http_negotiate.c | 2 +- php_http_persistent_handle.c | 22 ++++++++++------------ php_http_property_proxy.c | 2 +- php_http_querystring.c | 6 +++--- php_http_request.c | 8 ++++---- 12 files changed, 45 insertions(+), 47 deletions(-) diff --git a/php_http_cookie.c b/php_http_cookie.c index 35b3728..146b086 100644 --- a/php_http_cookie.c +++ b/php_http_cookie.c @@ -79,7 +79,7 @@ PHP_HTTP_API void php_http_cookie_list_free(php_http_cookie_list_t **list) PHP_HTTP_API const char *php_http_cookie_list_get_cookie(php_http_cookie_list_t *list, const char *name, size_t name_len) { zval **cookie = NULL; - if ((SUCCESS != zend_hash_find(&list->cookies, name, name_len + 1, (void *) &cookie)) || (Z_TYPE_PP(cookie) != IS_STRING)) { + if ((SUCCESS != zend_symtable_find(&list->cookies, name, name_len + 1, (void *) &cookie)) || (Z_TYPE_PP(cookie) != IS_STRING)) { return NULL; } return Z_STRVAL_PP(cookie); @@ -90,7 +90,7 @@ PHP_HTTP_API const char *php_http_cookie_list_get_cookie(php_http_cookie_list_t PHP_HTTP_API const char *php_http_cookie_list_get_extra(php_http_cookie_list_t *list, const char *name, size_t name_len) { zval **extra = NULL; - if ((SUCCESS != zend_hash_find(&list->extras, name, name_len + 1, (void *) &extra)) || (Z_TYPE_PP(extra) != IS_STRING)) { + if ((SUCCESS != zend_symtable_find(&list->extras, name, name_len + 1, (void *) &extra)) || (Z_TYPE_PP(extra) != IS_STRING)) { return NULL; } return Z_STRVAL_PP(extra); @@ -104,7 +104,7 @@ PHP_HTTP_API void php_http_cookie_list_add_cookie(php_http_cookie_list_t *list, MAKE_STD_ZVAL(cookie_value); ZVAL_STRINGL(cookie_value, estrndup(value, value_len), value_len, 0); - zend_hash_update(&list->cookies, name, name_len + 1, (void *) &cookie_value, sizeof(zval *), NULL); + zend_symtable_update(&list->cookies, name, name_len + 1, (void *) &cookie_value, sizeof(zval *), NULL); } @@ -115,7 +115,7 @@ PHP_HTTP_API void php_http_cookie_list_add_extra(php_http_cookie_list_t *list, c MAKE_STD_ZVAL(cookie_value); ZVAL_STRINGL(cookie_value, estrndup(value, value_len), value_len, 0); - zend_hash_update(&list->extras, name, name_len + 1, (void *) &cookie_value, sizeof(zval *), NULL); + zend_symtable_update(&list->extras, name, name_len + 1, (void *) &cookie_value, sizeof(zval *), NULL); } @@ -669,7 +669,7 @@ PHP_METHOD(HttpCookie, getCookie) if (!obj->list) { obj->list = php_http_cookie_list_init(NULL TSRMLS_CC); } - if (SUCCESS == zend_hash_find(&obj->list->cookies, name_str, name_len + 1, (void *) &zvalue)) { + if (SUCCESS == zend_symtable_find(&obj->list->cookies, name_str, name_len + 1, (void *) &zvalue)) { RETURN_ZVAL(*zvalue, 1, 0); } } @@ -688,13 +688,13 @@ PHP_METHOD(HttpCookie, setCookie) obj->list = php_http_cookie_list_init(NULL TSRMLS_CC); } if (!value_str) { - zend_hash_del(&obj->list->cookies, name_str, name_len + 1); + zend_symtable_del(&obj->list->cookies, name_str, name_len + 1); } else { zval *zvalue; MAKE_STD_ZVAL(zvalue); ZVAL_STRINGL(zvalue, value_str, value_len, 1); - zend_hash_update(&obj->list->cookies, name_str, name_len + 1, &zvalue, sizeof(zval *), NULL); + zend_symtable_update(&obj->list->cookies, name_str, name_len + 1, &zvalue, sizeof(zval *), NULL); } } RETVAL_ZVAL(getThis(), 1, 0); @@ -714,7 +714,7 @@ PHP_METHOD(HttpCookie, addCookie) } MAKE_STD_ZVAL(zvalue); ZVAL_STRINGL(zvalue, value_str, value_len, 1); - zend_hash_add(&obj->list->cookies, name_str, name_len + 1, &zvalue, sizeof(zval *), NULL); + zend_symtable_update(&obj->list->cookies, name_str, name_len + 1, &zvalue, sizeof(zval *), NULL); } RETVAL_ZVAL(getThis(), 1, 0); } @@ -731,7 +731,7 @@ PHP_METHOD(HttpCookie, getExtra) if (!obj->list) { obj->list = php_http_cookie_list_init(NULL TSRMLS_CC); } - if (SUCCESS == zend_hash_find(&obj->list->extras, name_str, name_len + 1, (void *) &zvalue)) { + if (SUCCESS == zend_symtable_find(&obj->list->extras, name_str, name_len + 1, (void *) &zvalue)) { RETURN_ZVAL(*zvalue, 1, 0); } } @@ -750,13 +750,13 @@ PHP_METHOD(HttpCookie, setExtra) obj->list = php_http_cookie_list_init(NULL TSRMLS_CC); } if (!value_str) { - zend_hash_del(&obj->list->extras, name_str, name_len + 1); + zend_symtable_del(&obj->list->extras, name_str, name_len + 1); } else { zval *zvalue; MAKE_STD_ZVAL(zvalue); ZVAL_STRINGL(zvalue, value_str, value_len, 1); - zend_hash_update(&obj->list->extras, name_str, name_len + 1, &zvalue, sizeof(zval *), NULL); + zend_symtable_update(&obj->list->extras, name_str, name_len + 1, &zvalue, sizeof(zval *), NULL); } } RETVAL_ZVAL(getThis(), 1, 0); @@ -776,7 +776,7 @@ PHP_METHOD(HttpCookie, addExtra) } MAKE_STD_ZVAL(zvalue); ZVAL_STRINGL(zvalue, value_str, value_len, 1); - zend_hash_add(&obj->list->extras, name_str, name_len + 1, &zvalue, sizeof(zval *), NULL); + zend_symtable_update(&obj->list->extras, name_str, name_len + 1, &zvalue, sizeof(zval *), NULL); } RETVAL_ZVAL(getThis(), 1, 0); } diff --git a/php_http_cookie.h b/php_http_cookie.h index 9307358..5d2d3a3 100644 --- a/php_http_cookie.h +++ b/php_http_cookie.h @@ -44,11 +44,11 @@ PHP_HTTP_API php_http_cookie_list_t *php_http_cookie_list_copy(php_http_cookie_l PHP_HTTP_API void php_http_cookie_list_dtor(php_http_cookie_list_t *list); PHP_HTTP_API void php_http_cookie_list_free(php_http_cookie_list_t **list); -#define php_http_cookie_list_has_cookie(list, name, name_len) zend_hash_exists(&(list)->cookies, (name), (name_len)+1) +#define php_http_cookie_list_has_cookie(list, name, name_len) zend_symtable_exists(&(list)->cookies, (name), (name_len)+1) PHP_HTTP_API void php_http_cookie_list_add_cookie(php_http_cookie_list_t *list, const char *name, size_t name_len, const char *value, size_t value_len); PHP_HTTP_API const char *php_http_cookie_list_get_cookie(php_http_cookie_list_t *list, const char *name, size_t name_len); -#define php_http_cookie_list_has_extra(list, name, name_len) zend_hash_exists(&(list)->extras, (name), (name_len)+1) +#define php_http_cookie_list_has_extra(list, name, name_len) zend_symtable_exists(&(list)->extras, (name), (name_len)+1) PHP_HTTP_API void php_http_cookie_list_add_extra(php_http_cookie_list_t *list, const char *name, size_t name_len, const char *value, size_t value_len); PHP_HTTP_API const char *php_http_cookie_list_get_extra(php_http_cookie_list_t *list, const char *name, size_t name_len); diff --git a/php_http_env.c b/php_http_env.c index b936ab1..8f4036a 100644 --- a/php_http_env.c +++ b/php_http_env.c @@ -62,7 +62,7 @@ PHP_HTTP_API void php_http_env_get_request_headers(HashTable *headers TSRMLS_DC) zend_hash_get_current_data_ex(Z_ARRVAL_PP(hsv), (void *) &header, &pos); Z_ADDREF_P(*header); - zend_hash_add(PHP_HTTP_G->env.request.headers, key.str, key.len, (void *) header, sizeof(zval *), NULL); + zend_symtable_update(PHP_HTTP_G->env.request.headers, key.str, key.len, (void *) header, sizeof(zval *), NULL); efree(key.str); } @@ -82,7 +82,7 @@ PHP_HTTP_API char *php_http_env_get_request_header(const char *name_str, size_t php_http_env_get_request_headers(NULL TSRMLS_CC); - if (SUCCESS == zend_hash_find(PHP_HTTP_G->env.request.headers, key, name_len + 1, (void *) &zvalue)) { + if (SUCCESS == zend_symtable_find(PHP_HTTP_G->env.request.headers, key, name_len + 1, (void *) &zvalue)) { zval *zcopy = php_http_ztyp(IS_STRING, *zvalue); val = estrndup(Z_STRVAL_P(zcopy), Z_STRLEN_P(zcopy)); @@ -100,7 +100,7 @@ PHP_HTTP_API int php_http_env_got_request_header(const char *name_str, size_t na int got; php_http_env_get_request_headers(NULL TSRMLS_CC); - got = zend_hash_exists(PHP_HTTP_G->env.request.headers, key, name_len + 1); + got = zend_symtable_exists(PHP_HTTP_G->env.request.headers, key, name_len + 1); efree(key); return got; @@ -129,7 +129,7 @@ PHP_HTTP_API zval *php_http_env_get_server_var(const char *key, size_t key_len, if ((SUCCESS != zend_hash_find(&EG(symbol_table), ZEND_STRS("_SERVER"), (void *) &hsv)) || (Z_TYPE_PP(hsv) != IS_ARRAY)) { return NULL; } - if ((SUCCESS != zend_hash_find(Z_ARRVAL_PP(hsv), key, key_len + 1, (void *) &var))) { + if ((SUCCESS != zend_symtable_find(Z_ARRVAL_PP(hsv), key, key_len + 1, (void *) &var))) { return NULL; } if (check && !((Z_TYPE_PP(var) == IS_STRING) && Z_STRVAL_PP(var) && Z_STRLEN_PP(var))) { @@ -355,7 +355,7 @@ PHP_HTTP_API char *php_http_env_get_response_header(const char *name_str, size_t zval **zvalue; char *key = php_http_pretty_key(estrndup(name_str, name_len), name_len, 1, 1); - if (SUCCESS == zend_hash_find(&headers, key, name_len + 1, (void *) &zvalue)) { + if (SUCCESS == zend_symtable_find(&headers, key, name_len + 1, (void *) &zvalue)) { zval *zcopy = php_http_ztyp(IS_STRING, *zvalue); val = estrndup(Z_STRVAL_P(zcopy), Z_STRLEN_P(zcopy)); diff --git a/php_http_env_response.c b/php_http_env_response.c index f6e23cf..a374b42 100644 --- a/php_http_env_response.c +++ b/php_http_env_response.c @@ -70,7 +70,7 @@ static zval *get_option(zval *options, const char *name_str, size_t name_len TSR val = zend_read_property(Z_OBJCE_P(options), options, name, name_len, 0 TSRMLS_CC); efree(name); } else { - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(options), name_str, name_len + 1, (void *) &valptr)) { + if (SUCCESS == zend_symtable_find(Z_ARRVAL_P(options), name_str, name_len + 1, (void *) &valptr)) { val = *valptr; } else { val = NULL; diff --git a/php_http_header_parser.c b/php_http_header_parser.c index c48e7c6..c0b4515 100644 --- a/php_http_header_parser.c +++ b/php_http_header_parser.c @@ -175,7 +175,7 @@ PHP_HTTP_API STATUS php_http_header_parser_parse(php_http_header_parser_t *parse INIT_PZVAL_ARRAY(&array, headers); php_http_pretty_key(parser->_key.str, parser->_key.len, 1, 1); - if (SUCCESS == zend_hash_find(headers, parser->_key.str, parser->_key.len + 1, (void *) &exist)) { + if (SUCCESS == zend_symtable_find(headers, parser->_key.str, parser->_key.len + 1, (void *) &exist)) { convert_to_array(*exist); add_next_index_stringl(*exist, parser->_val.str, parser->_val.len, 0); } else { diff --git a/php_http_message.c b/php_http_message.c index 12c189e..20ed46f 100644 --- a/php_http_message.c +++ b/php_http_message.c @@ -149,7 +149,7 @@ PHP_HTTP_API zval *php_http_message_header(php_http_message_t *msg, char *key_st zval *ret = NULL, **header; char *key = php_http_pretty_key(estrndup(key_str, key_len), key_len, 1, 1); - if (SUCCESS == zend_hash_find(&msg->hdrs, key, key_len + 1, (void *) &header)) { + if (SUCCESS == zend_symtable_find(&msg->hdrs, key, key_len + 1, (void *) &header)) { if (join && Z_TYPE_PP(header) == IS_ARRAY) { zval *header_str, **val; HashPosition pos; @@ -1392,10 +1392,10 @@ PHP_METHOD(HttpMessage, setHeader) } if (!zvalue) { - zend_hash_del(&obj->message->hdrs, name, name_len + 1); + zend_symtable_del(&obj->message->hdrs, name, name_len + 1); } else { Z_ADDREF_P(zvalue); - zend_hash_update(&obj->message->hdrs, name, name_len + 1, &zvalue, sizeof(void *), NULL); + zend_symtable_update(&obj->message->hdrs, name, name_len + 1, &zvalue, sizeof(void *), NULL); } efree(name); } @@ -1441,7 +1441,7 @@ PHP_METHOD(HttpMessage, addHeader) convert_to_array(header); zend_hash_next_index_insert(Z_ARRVAL_P(header), &zvalue, sizeof(void *), NULL); } else { - zend_hash_update(&obj->message->hdrs, name, name_len + 1, &zvalue, sizeof(void *), NULL); + zend_symtable_update(&obj->message->hdrs, name, name_len + 1, &zvalue, sizeof(void *), NULL); } efree(name); } diff --git a/php_http_misc.c b/php_http_misc.c index 377aa9a..416e95d 100644 --- a/php_http_misc.c +++ b/php_http_misc.c @@ -142,7 +142,7 @@ int php_http_array_apply_append_func(void *pDest TSRMLS_DC, int num_args, va_lis } add_next_index_zval(*data, *value); } else if (key) { - zend_hash_add(dst, key, hash_key->nKeyLength, value, sizeof(zval *), NULL); + zend_symtable_update(dst, key, hash_key->nKeyLength, value, sizeof(zval *), NULL); } else { zend_hash_quick_add(dst, hash_key->arKey, hash_key->nKeyLength, hash_key->h, value, sizeof(zval *), NULL); } diff --git a/php_http_negotiate.c b/php_http_negotiate.c index b8f50f1..7fb7c56 100644 --- a/php_http_negotiate.c +++ b/php_http_negotiate.c @@ -149,7 +149,7 @@ PHP_HTTP_API HashTable *php_http_negotiate(const char *value, HashTable *support if ((selected = neg(identifier, &quality, supported TSRMLS_CC))) { /* don't overwrite previously set with higher quality */ - if (!zend_hash_exists(Z_ARRVAL(array), selected, strlen(selected) + 1)) { + if (!zend_symtable_exists(Z_ARRVAL(array), selected, strlen(selected) + 1)) { add_assoc_double(&array, selected, quality); } } diff --git a/php_http_persistent_handle.c b/php_http_persistent_handle.c index 720e8e6..c174a04 100644 --- a/php_http_persistent_handle.c +++ b/php_http_persistent_handle.c @@ -94,7 +94,7 @@ static inline php_http_persistent_handle_list_t *php_http_persistent_handle_list { php_http_persistent_handle_list_t **list, *new_list; - if (SUCCESS == zend_hash_find(&provider->list.free, ident_str, ident_len + 1, (void *) &list)) { + if (SUCCESS == zend_symtable_find(&provider->list.free, ident_str, ident_len + 1, (void *) &list)) { #if PHP_HTTP_DEBUG_PHANDLES fprintf(stderr, "LSTFIND: %p\n", *list); #endif @@ -102,7 +102,7 @@ static inline php_http_persistent_handle_list_t *php_http_persistent_handle_list } if ((new_list = php_http_persistent_handle_list_init(NULL))) { - if (SUCCESS == zend_hash_add(&provider->list.free, ident_str, ident_len + 1, (void *) &new_list, sizeof(php_http_persistent_handle_list_t *), (void *) &list)) { + if (SUCCESS == zend_symtable_update(&provider->list.free, ident_str, ident_len + 1, (void *) &new_list, sizeof(php_http_persistent_handle_list_t *), (void *) &list)) { #if PHP_HTTP_DEBUG_PHANDLES fprintf(stderr, "LSTFIND: %p (new)\n", *list); #endif @@ -224,7 +224,7 @@ PHP_HTTP_API STATUS php_http_persistent_handle_provide(const char *name_str, siz fprintf(stderr, "PROVIDE: %s\n", name_str); #endif - if (SUCCESS == zend_hash_add(&php_http_persistent_handles_hash, name_str, name_len+1, (void *) &provider, sizeof(php_http_persistent_handle_provider_t), NULL)) { + if (SUCCESS == zend_symtable_update(&php_http_persistent_handles_hash, name_str, name_len+1, (void *) &provider, sizeof(php_http_persistent_handle_provider_t), NULL)) { status = SUCCESS; } else { php_http_resource_factory_dtor(&provider.rf); @@ -247,7 +247,7 @@ PHP_HTTP_API php_http_persistent_handle_factory_t *php_http_persistent_handle_co memset(a, 0, sizeof(*a)); LOCK(); - status = zend_hash_find(&php_http_persistent_handles_hash, name_str, name_len+1, (void *) &a->provider); + status = zend_symtable_find(&php_http_persistent_handles_hash, name_str, name_len+1, (void *) &a->provider); UNLOCK(); if (SUCCESS == status) { @@ -316,7 +316,7 @@ PHP_HTTP_API STATUS php_http_persistent_handle_acquire2(const char *name_str, si *handle = NULL; LOCK(); - if (SUCCESS == zend_hash_find(&php_http_persistent_handles_hash, name_str, name_len+1, (void *) &provider)) { + if (SUCCESS == zend_symtable_find(&php_http_persistent_handles_hash, name_str, name_len+1, (void *) &provider)) { status = php_http_persistent_handle_do_acquire(provider, ident_str, ident_len, handle TSRMLS_CC); } UNLOCK(); @@ -337,7 +337,7 @@ PHP_HTTP_API STATUS php_http_persistent_handle_release2(const char *name_str, si #endif LOCK(); - if (SUCCESS == zend_hash_find(&php_http_persistent_handles_hash, name_str, name_len+1, (void *) &provider)) { + if (SUCCESS == zend_symtable_find(&php_http_persistent_handles_hash, name_str, name_len+1, (void *) &provider)) { status = php_http_persistent_handle_do_release(provider, ident_str, ident_len, handle TSRMLS_CC); } UNLOCK(); @@ -356,7 +356,7 @@ PHP_HTTP_API STATUS php_http_persistent_handle_accrete2(const char *name_str, si *new_handle = NULL; LOCK(); - if (SUCCESS == zend_hash_find(&php_http_persistent_handles_hash, name_str, name_len+1, (void *) &provider)) { + if (SUCCESS == zend_symtable_find(&php_http_persistent_handles_hash, name_str, name_len+1, (void *) &provider)) { status = php_http_persistent_handle_do_accrete(provider, ident_str, ident_len, old_handle, new_handle TSRMLS_CC); } UNLOCK(); @@ -376,7 +376,7 @@ PHP_HTTP_API void php_http_persistent_handle_cleanup(const char *name_str, size_ LOCK(); if (name_str && name_len) { - if (SUCCESS == zend_hash_find(&php_http_persistent_handles_hash, name_str, name_len+1, (void *) &provider)) { + if (SUCCESS == zend_symtable_find(&php_http_persistent_handles_hash, name_str, name_len+1, (void *) &provider)) { if (ident_str && ident_len) { if ((list = php_http_persistent_handle_list_find(provider, ident_str, ident_len TSRMLS_CC))) { php_http_persistent_handle_list_dtor(list, provider TSRMLS_CC); @@ -431,12 +431,10 @@ PHP_HTTP_API HashTable *php_http_persistent_handle_statall(HashTable *ht TSRMLS_ array_init(zentry[1]); add_assoc_long_ex(zentry[1], ZEND_STRS("used"), (*list)->used); add_assoc_long_ex(zentry[1], ZEND_STRS("free"), zend_hash_num_elements(&(*list)->free)); - - /* use zend_hash_* not add_assoc_* (which is zend_symtable_*) as we want a string even for numbers */ - zend_hash_add(Z_ARRVAL_P(zentry[0]), key2.str, key2.len, &zentry[1], sizeof(zval *), NULL); + add_assoc_zval_ex(zentry[0], key2.str, key2.len, zentry[1]); } - zend_hash_add(ht, key1.str, key1.len, &zentry[0], sizeof(zval *), NULL); + zend_symtable_update(ht, key1.str, key1.len, &zentry[0], sizeof(zval *), NULL); } } else if (ht) { ht = NULL; diff --git a/php_http_property_proxy.c b/php_http_property_proxy.c index 426f3c3..35e725a 100644 --- a/php_http_property_proxy.c +++ b/php_http_property_proxy.c @@ -127,7 +127,7 @@ static zval *php_http_property_proxy_object_read_dimension(zval *object, zval *o } } else { offset = php_http_ztyp(IS_STRING, offset); - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(property), Z_STRVAL_P(offset), Z_STRLEN_P(offset), (void *) &data)) { + if (SUCCESS == zend_symtable_find(Z_ARRVAL_P(property), Z_STRVAL_P(offset), Z_STRLEN_P(offset), (void *) &data)) { retval = *data; } zval_ptr_dtor(&offset); diff --git a/php_http_querystring.c b/php_http_querystring.c index ab2bc3d..d77bbda 100644 --- a/php_http_querystring.c +++ b/php_http_querystring.c @@ -350,7 +350,7 @@ static inline void php_http_querystring_get(zval *this_ptr, int type, char *name { zval **arrval, *qarray = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0 TSRMLS_CC); - if ((Z_TYPE_P(qarray) == IS_ARRAY) && (SUCCESS == zend_hash_find(Z_ARRVAL_P(qarray), name, name_len + 1, (void *) &arrval))) { + if ((Z_TYPE_P(qarray) == IS_ARRAY) && (SUCCESS == zend_symtable_find(Z_ARRVAL_P(qarray), name, name_len + 1, (void *) &arrval))) { if (type) { zval *value = php_http_ztyp(type, *arrval); RETVAL_ZVAL(value, 1, 1); @@ -599,7 +599,7 @@ PHP_METHOD(HttpQueryString, offsetGet) zval *qa = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0 TSRMLS_CC); if (Z_TYPE_P(qa) == IS_ARRAY - && SUCCESS == zend_hash_find(Z_ARRVAL_P(qa), offset_str, offset_len + 1, (void *) &value) + && SUCCESS == zend_symtable_find(Z_ARRVAL_P(qa), offset_str, offset_len + 1, (void *) &value) ) { RETVAL_ZVAL(*value, 1, 0); } @@ -634,7 +634,7 @@ PHP_METHOD(HttpQueryString, offsetExists) zval *qa = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0 TSRMLS_CC); if (Z_TYPE_P(qa) == IS_ARRAY - && SUCCESS == zend_hash_find(Z_ARRVAL_P(qa), offset_str, offset_len + 1, (void *) &value) + && SUCCESS == zend_symtable_find(Z_ARRVAL_P(qa), offset_str, offset_len + 1, (void *) &value) && Z_TYPE_PP(value) != IS_NULL ) { RETURN_TRUE; diff --git a/php_http_request.c b/php_http_request.c index 857beea..7320856 100644 --- a/php_http_request.c +++ b/php_http_request.c @@ -566,7 +566,7 @@ static inline void php_http_request_object_set_options_subr(INTERNAL_FUNCTION_PA array_copy(Z_ARRVAL_P(old_opts), Z_ARRVAL_P(new_opts)); } - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(new_opts), key, len, (void *) &entry)) { + if (SUCCESS == zend_symtable_find(Z_ARRVAL_P(new_opts), key, len, (void *) &entry)) { if (overwrite) { zend_hash_clean(Z_ARRVAL_PP(entry)); } @@ -600,7 +600,7 @@ static inline void php_http_request_object_get_options_subr(INTERNAL_FUNCTION_PA array_init(return_value); if ( (Z_TYPE_P(opts) == IS_ARRAY) && - (SUCCESS == zend_hash_find(Z_ARRVAL_P(opts), key, len, (void *) &options))) { + (SUCCESS == zend_symtable_find(Z_ARRVAL_P(opts), key, len, (void *) &options))) { convert_to_array(*options); array_copy(Z_ARRVAL_PP(options), Z_ARRVAL_P(return_value)); } @@ -717,7 +717,7 @@ PHP_METHOD(HttpRequest, getTransferInfo) } if (info_len && info_name) { - if (SUCCESS == zend_hash_find(Z_ARRVAL_P(info), php_http_pretty_key(info_name, info_len, 0, 0), info_len + 1, (void *) &infop)) { + if (SUCCESS == zend_symtable_find(Z_ARRVAL_P(info), php_http_pretty_key(info_name, info_len, 0, 0), info_len + 1, (void *) &infop)) { RETVAL_ZVAL(*infop, 1, 0); } else { php_http_error(HE_NOTICE, PHP_HTTP_E_INVALID_PARAM, "Could not find transfer info named %s", info_name); @@ -789,7 +789,7 @@ PHP_METHOD(HttpRequest, setOptions) } else if (Z_TYPE_PP(opt) == IS_NULL) { old_opts = zend_read_property(php_http_request_class_entry, getThis(), ZEND_STRL("options"), 0 TSRMLS_CC); if (Z_TYPE_P(old_opts) == IS_ARRAY) { - zend_hash_del(Z_ARRVAL_P(old_opts), key.str, key.len); + zend_symtable_del(Z_ARRVAL_P(old_opts), key.str, key.len); } } else { Z_ADDREF_P(*opt); -- 2.30.2