summaryrefslogtreecommitdiff
path: root/src/cache.c
diff options
context:
space:
mode:
authorjcid <devnull@localhost>2008-01-08 13:22:34 +0100
committerjcid <devnull@localhost>2008-01-08 13:22:34 +0100
commit2df3c4430232da9ef20b4eb3a50877bf9a5e81ef (patch)
tree23c1a30b592cf17caf436d987ff363bb6003810f /src/cache.c
parent1637de6b9561d80b5cfceb2a675fc0ac3364aabe (diff)
- Added a MSG_HTTP for HTTP/1.1's warning headers.
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/cache.c b/src/cache.c
index 0d8b537c..2336fb93 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -417,7 +417,6 @@ static char *Cache_parse_field(const char *header, const char *fieldname)
return NULL;
}
-#ifndef DISABLE_COOKIES
/*
* Extract multiple fields from the header.
*/
@@ -451,7 +450,6 @@ static Dlist *Cache_parse_multiple_fields(const char *header,
}
return fields;
}
-#endif /* !DISABLE_COOKIES */
/*
* Scan, allocate, and set things according to header info.
@@ -463,9 +461,10 @@ static void Cache_parse_header(CacheEntry_t *entry)
char *Length, *Type, *location_str, *encoding;
#ifndef DISABLE_COOKIES
Dlist *Cookies;
+#endif
+ Dlist *warnings;
void *data;
int i;
-#endif
if (entry->Header->len > 12) {
if (header[9] == '1' && header[10] == '0' && header[11] == '0') {
@@ -493,6 +492,14 @@ static void Cache_parse_header(CacheEntry_t *entry)
}
}
+ if ((warnings = Cache_parse_multiple_fields(header, "Warning"))) {
+ for (i = 0; (data = dList_nth_data(warnings, i)); ++i) {
+ MSG_HTTP("%s\n", (char *)data);
+ dFree(data);
+ }
+ dList_free(warnings);
+ }
+
if ((Length = Cache_parse_field(header, "Content-Length")) != NULL) {
char *tmp;
if ((tmp = Cache_parse_field(header, "Transfer-Encoding"))) {