projects
/
m6w6
/
ext-http
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (from parent 1:
e76f270
)
use zend_symtable where appropriate
author
Michael Wallner
<mike@php.net>
Thu, 28 Jul 2011 11:11:40 +0000
(11:11 +0000)
committer
Michael Wallner
<mike@php.net>
Thu, 28 Jul 2011 11:11:40 +0000
(11:11 +0000)
12 files changed:
php_http_cookie.c
patch
|
blob
|
history
php_http_cookie.h
patch
|
blob
|
history
php_http_env.c
patch
|
blob
|
history
php_http_env_response.c
patch
|
blob
|
history
php_http_header_parser.c
patch
|
blob
|
history
php_http_message.c
patch
|
blob
|
history
php_http_misc.c
patch
|
blob
|
history
php_http_negotiate.c
patch
|
blob
|
history
php_http_persistent_handle.c
patch
|
blob
|
history
php_http_property_proxy.c
patch
|
blob
|
history
php_http_querystring.c
patch
|
blob
|
history
php_http_request.c
patch
|
blob
|
history
diff --git
a/php_http_cookie.c
b/php_http_cookie.c
index 35b372886de9567bcc6efe68ee26f9325ddfd49f..146b08656c74ead4f50624f2bb84051db22341f4 100644
(file)
--- 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;
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);
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;
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);
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);
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);
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 (!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);
}
}
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) {
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);
} 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);
}
}
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);
}
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);
}
}
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 (!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);
}
}
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) {
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);
} 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);
}
}
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);
}
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);
}
}
RETVAL_ZVAL(getThis(), 1, 0);
}
diff --git
a/php_http_cookie.h
b/php_http_cookie.h
index 930735852fbb99d8ffa8bc5de3571b2618b9d792..5d2d3a33e3a13ecfaabdcc5547653a9c81eac398 100644
(file)
--- 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);
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);
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);
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 b936ab1fd56ebda48c6449afe125f73c8532f076..8f4036ab9013f114cb6e1de994ac80ab6e4143df 100644
(file)
--- 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_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);
}
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);
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));
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);
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;
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(&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))) {
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);
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));
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 f6e23cfa029252afd69829cf04f4438bd3a957b1..a374b425c74932ecd09642b034015ea6e2a53a39 100644
(file)
--- 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 {
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;
val = *valptr;
} else {
val = NULL;
diff --git
a/php_http_header_parser.c
b/php_http_header_parser.c
index c48e7c6193d990d23197308dd74710e5978898d9..c0b4515fe39ac2f5d2843476915e7fadd7c322b9 100644
(file)
--- 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);
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 {
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 12c189e8656dd6a1f1df37e1ec1f21f2a17aa5f8..20ed46f2648dfc2bde6cf1c1f6543d5bd63a1dfe 100644
(file)
--- 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);
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;
if (join && Z_TYPE_PP(header) == IS_ARRAY) {
zval *header_str, **val;
HashPosition pos;
@@
-1392,10
+1392,10
@@
PHP_METHOD(HttpMessage, setHeader)
}
if (!zvalue) {
}
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);
} 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);
}
}
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 {
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);
}
}
efree(name);
}
diff --git
a/php_http_misc.c
b/php_http_misc.c
index 377aa9af4a925790770924ea9749607ca3732f14..416e95d4f7727231c7ff28709c83d18dc24d4ad5 100644
(file)
--- 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) {
}
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);
}
} 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 b8f50f1105721a1de6c60d79424b77d3833d8c33..7fb7c568396e9d8e62d7ebcf976a6437103f2456 100644
(file)
--- 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 ((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);
}
}
add_assoc_double(&array, selected, quality);
}
}
diff --git
a/php_http_persistent_handle.c
b/php_http_persistent_handle.c
index 720e8e6f6d0daad292f43293159e49cf701250a8..c174a043d19d8a3344980a9c7cb261b45eb5ca57 100644
(file)
--- 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;
{
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
#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 ((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
#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
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);
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();
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) {
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();
*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();
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();
#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();
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();
*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();
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) {
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);
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));
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;
}
} else if (ht) {
ht = NULL;
diff --git
a/php_http_property_proxy.c
b/php_http_property_proxy.c
index 426f3c3dd2a6f5d63d7b7575d4c2f6b4df80c594..35e725a4b63d5afce949a4656f3325878bf02d88 100644
(file)
--- 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);
}
} 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);
retval = *data;
}
zval_ptr_dtor(&offset);
diff --git
a/php_http_querystring.c
b/php_http_querystring.c
index ab2bc3d384c89099cc301f3a8d7882d1f9305f72..d77bbdaceccfc5bdf1ac586527b14af8c9a47797 100644
(file)
--- 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);
{
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);
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
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);
}
) {
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
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;
&& Z_TYPE_PP(value) != IS_NULL
) {
RETURN_TRUE;
diff --git
a/php_http_request.c
b/php_http_request.c
index 857beea978dfc66014bd507b5ad3719848aa1afb..7320856b5390f980cf405a2eb438fb33d5f51865 100644
(file)
--- 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));
}
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));
}
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) &&
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));
}
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 (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);
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) {
} 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);
}
} else {
Z_ADDREF_P(*opt);