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:
687c841
)
- fix errenous bailout of http_parse_headers() introduced with last commit
author
Michael Wallner
<mike@php.net>
Wed, 5 Apr 2006 14:48:39 +0000
(14:48 +0000)
committer
Michael Wallner
<mike@php.net>
Wed, 5 Apr 2006 14:48:39 +0000
(14:48 +0000)
http_headers_api.c
patch
|
blob
|
history
diff --git
a/http_headers_api.c
b/http_headers_api.c
index 7ac475692aff101d66d18fd7d0ca278350686bd6..a5448a995c1a79eb86c442795e9040db8d8a17e0 100644
(file)
--- a/
http_headers_api.c
+++ b/
http_headers_api.c
@@
-328,9
+328,10
@@
PHP_HTTP_API STATUS _http_parse_headers_ex(const char *header, HashTable *header
{
const char *colon = NULL, *line = header;
zval array;
{
const char *colon = NULL, *line = header;
zval array;
-
+
INIT_ZARR(array, headers);
INIT_ZARR(array, headers);
+#define MORE_HEADERS (*(line-1) && !(*(line-1) == '\n' && (*line == '\n' || *line == '\r')))
do {
int value_len = 0;
do {
int value_len = 0;
@@
-353,11
+354,8
@@
PHP_HTTP_API STATUS _http_parse_headers_ex(const char *header, HashTable *header
callback_func(callback_data, &headers, &i TSRMLS_CC);
http_info_dtor(&i);
Z_ARRVAL(array) = headers;
callback_func(callback_data, &headers, &i TSRMLS_CC);
http_info_dtor(&i);
Z_ARRVAL(array) = headers;
- } else
-
- /* "header: value" pair */
- if (colon) {
-
+ } else if (colon) {
+ /* "header: value" pair */
/* skip empty key */
if (header != colon) {
zval **previous = NULL;
/* skip empty key */
if (header != colon) {
zval **previous = NULL;
@@
-395,7
+393,7
@@
PHP_HTTP_API STATUS _http_parse_headers_ex(const char *header, HashTable *header
}
efree(key);
}
}
efree(key);
}
- } else {
+ } else
if (MORE_HEADERS)
{
return FAILURE;
}
colon = NULL;
return FAILURE;
}
colon = NULL;
@@
-404,7
+402,7
@@
PHP_HTTP_API STATUS _http_parse_headers_ex(const char *header, HashTable *header
}
break;
}
}
break;
}
- } while (
*(line-1) && !(*(line-1) == '\n' && (*line == '\n' || *line == '\r'))
);
+ } while (
MORE_HEADERS
);
return SUCCESS;
}
return SUCCESS;
}