X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_env.c;h=8f4036ab9013f114cb6e1de994ac80ab6e4143df;hp=4b9ea88313c701fea0c765544dbc9c6f376ea0b6;hb=4062420a5e5d301db4a3d820be881e7675a242e1;hpb=dedad9f35cbeaee56e7cca145e378cc6548198e3 diff --git a/php_http_env.c b/php_http_env.c index 4b9ea88..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)); @@ -589,10 +589,6 @@ PHP_HTTP_BEGIN_ARGS(persistentHandlesClean, 0) PHP_HTTP_ARG_VAL(ident, 0) PHP_HTTP_END_ARGS; -PHP_HTTP_BEGIN_ARGS(persistentHandlesIdent, 0) - PHP_HTTP_ARG_VAL(name, 0) -PHP_HTTP_END_ARGS; - PHP_HTTP_BEGIN_ARGS(parseParams, 1) PHP_HTTP_ARG_VAL(params, 0) PHP_HTTP_ARG_VAL(flags, 0) @@ -928,7 +924,7 @@ PHP_MINIT_FUNCTION(http_env) zend_declare_class_constant_long(php_http_env_class_entry, ZEND_STRL("PARAMS_DEFAULT"), PHP_HTTP_PARAMS_DEFAULT TSRMLS_CC); zend_declare_class_constant_long(php_http_env_class_entry, ZEND_STRL("PARAMS_COLON_SEPARATOR"), PHP_HTTP_PARAMS_COLON_SEPARATOR TSRMLS_CC); - PHP_HTTP_REGISTER_CLASS(http\\env, Request, http_env_request, php_http_message_class_entry, 0); + PHP_HTTP_REGISTER_CLASS(http\\Env, Request, http_env_request, php_http_message_class_entry, 0); return SUCCESS; }