projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
use zend_symtable where appropriate
[m6w6/ext-http]
/
php_http_env.c
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));