projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
fiy typo
[m6w6/ext-http]
/
php_http_cookie.c
diff --git
a/php_http_cookie.c
b/php_http_cookie.c
index 35b372886de9567bcc6efe68ee26f9325ddfd49f..1bfa734fd60ebc8c05bd1830cb086600c97e1c94 100644
(file)
--- a/
php_http_cookie.c
+++ b/
php_http_cookie.c
@@
-6,12
+6,10
@@
| modification, are permitted provided that the conditions mentioned |
| in the accompanying LICENSE file are met. |
+--------------------------------------------------------------------+
| modification, are permitted provided that the conditions mentioned |
| in the accompanying LICENSE file are met. |
+--------------------------------------------------------------------+
- | Copyright (c) 2004-201
0
, Michael Wallner <mike@php.net> |
+ | Copyright (c) 2004-201
1
, Michael Wallner <mike@php.net> |
+--------------------------------------------------------------------+
*/
+--------------------------------------------------------------------+
*/
-/* $Id: http_cookie_api.c 298662 2010-04-27 13:42:32Z mike $ */
-
#include "php_http.h"
#include <ext/date/php_date.h>
#include "php_http.h"
#include <ext/date/php_date.h>
@@
-79,7
+77,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
+88,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
+102,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
+113,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
+667,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
+686,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
+712,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
+729,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
+748,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
+774,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);
}