projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
silly mistake
[m6w6/ext-http]
/
http_cookie_api.c
diff --git
a/http_cookie_api.c
b/http_cookie_api.c
index 9b7c9b80f77d2fbe7cd16240583388b17341bd96..5776b87caecd43d052efac87f3bb5e5b453a676a 100644
(file)
--- a/
http_cookie_api.c
+++ b/
http_cookie_api.c
@@
-6,7
+6,7
@@
| 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-20
07
, Michael Wallner <mike@php.net> |
+ | Copyright (c) 2004-20
10
, Michael Wallner <mike@php.net> |
+--------------------------------------------------------------------+
*/
+--------------------------------------------------------------------+
*/
@@
-77,7
+77,7
@@
PHP_HTTP_API void _http_cookie_list_free(http_cookie_list **list TSRMLS_DC)
PHP_HTTP_API const char *_http_cookie_list_get_cookie(http_cookie_list *list, const char *name, size_t name_len TSRMLS_DC)
{
zval **cookie = NULL;
PHP_HTTP_API const char *_http_cookie_list_get_cookie(http_cookie_list *list, const char *name, size_t name_len TSRMLS_DC)
{
zval **cookie = NULL;
- if ((SUCCESS != zend_hash_find(&list->cookies, (char *) name, name_len + 1, (void *) &cookie)) || (Z_TYPE_PP(cookie) != IS_STRING)) {
+ if ((SUCCESS != zend_hash_find(&list->cookies,
HTTP_ZAPI_CONST_CAST
(char *) 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);
@@
-88,7
+88,7
@@
PHP_HTTP_API const char *_http_cookie_list_get_cookie(http_cookie_list *list, co
PHP_HTTP_API const char *_http_cookie_list_get_extra(http_cookie_list *list, const char *name, size_t name_len TSRMLS_DC)
{
zval **extra = NULL;
PHP_HTTP_API const char *_http_cookie_list_get_extra(http_cookie_list *list, const char *name, size_t name_len TSRMLS_DC)
{
zval **extra = NULL;
- if ((SUCCESS != zend_hash_find(&list->extras, (char *) name, name_len + 1, (void *) &extra)) || (Z_TYPE_PP(extra) != IS_STRING)) {
+ if ((SUCCESS != zend_hash_find(&list->extras,
HTTP_ZAPI_CONST_CAST
(char *) 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);
@@
-249,9
+249,9
@@
PHP_HTTP_API http_cookie_list *_http_cookie_list_fromstruct(http_cookie_list *li
list->flags = (long) Z_DVAL_PP(tmp);
break;
case IS_STRING:
list->flags = (long) Z_DVAL_PP(tmp);
break;
case IS_STRING:
- cpy =
zval_copy
(IS_LONG, *tmp);
+ cpy =
http_zsep
(IS_LONG, *tmp);
list->flags = Z_LVAL_P(cpy);
list->flags = Z_LVAL_P(cpy);
- zval_
free
(&cpy);
+ zval_
ptr_dtor
(&cpy);
break;
default:
break;
break;
default:
break;
@@
-266,7
+266,7
@@
PHP_HTTP_API http_cookie_list *_http_cookie_list_fromstruct(http_cookie_list *li
list->expires = (long) Z_DVAL_PP(tmp);
break;
case IS_STRING:
list->expires = (long) Z_DVAL_PP(tmp);
break;
case IS_STRING:
- cpy =
zval_copy
(IS_LONG, *tmp);
+ cpy =
http_zsep
(IS_LONG, *tmp);
if (Z_LVAL_P(cpy)) {
list->expires = Z_LVAL_P(cpy);
} else {
if (Z_LVAL_P(cpy)) {
list->expires = Z_LVAL_P(cpy);
} else {
@@
-275,7
+275,7
@@
PHP_HTTP_API http_cookie_list *_http_cookie_list_fromstruct(http_cookie_list *li
list->expires = expires;
}
}
list->expires = expires;
}
}
- zval_
free
(&cpy);
+ zval_
ptr_dtor
(&cpy);
break;
default:
break;
break;
default:
break;
@@
-323,7
+323,9
@@
PHP_HTTP_API void _http_cookie_list_tostring(http_cookie_list *list, char **str,
FOREACH_HASH_KEYVAL(pos, &list->cookies, key, val) {
if (key.type == HASH_KEY_IS_STRING && key.len) {
FOREACH_HASH_KEYVAL(pos, &list->cookies, key, val) {
if (key.type == HASH_KEY_IS_STRING && key.len) {
- append_encoded(&buf, key.str, key.len-1, Z_STRVAL_PP(val), Z_STRLEN_PP(val));
+ zval *tmp = http_zsep(IS_STRING, *val);
+ append_encoded(&buf, key.str, key.len-1, Z_STRVAL_P(tmp), Z_STRLEN_P(tmp));
+ zval_ptr_dtor(&tmp);
}
}
}
}
@@
-341,7
+343,8
@@
PHP_HTTP_API void _http_cookie_list_tostring(http_cookie_list *list, char **str,
FOREACH_HASH_KEYVAL(pos, &list->extras, key, val) {
if (key.type == HASH_KEY_IS_STRING && key.len) {
FOREACH_HASH_KEYVAL(pos, &list->extras, key, val) {
if (key.type == HASH_KEY_IS_STRING && key.len) {
- append_encoded(&buf, key.str, key.len-1, Z_STRVAL_PP(val), Z_STRLEN_PP(val));
+ zval *tmp = http_zsep(IS_STRING, *val);
+ append_encoded(&buf, key.str, key.len-1, Z_STRVAL_P(tmp), Z_STRLEN_P(tmp));
}
}
}
}