diff options
author | jcid <devnull@localhost> | 2007-11-20 01:02:44 +0100 |
---|---|---|
committer | jcid <devnull@localhost> | 2007-11-20 01:02:44 +0100 |
commit | 4cd23d44a0d38c61dd3bfb8cbbcc4a098f43f4d2 (patch) | |
tree | b216b42d322c08a3862889eaee600d13f0c3f83f /src/cache.c | |
parent | ea998e1c7dd08208f0e2bbdc31bae9677b8536b7 (diff) |
.
Diffstat (limited to 'src/cache.c')
-rw-r--r-- | src/cache.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/cache.c b/src/cache.c index 84e93fc6..18347099 100644 --- a/src/cache.c +++ b/src/cache.c @@ -468,23 +468,22 @@ static void Cache_parse_header(CacheEntry_t *entry, int i; #endif - if (HdrLen < 12) { - /* Not enough info. */ - - } if (header[9] == '3' && header[10] == '0') { - /* 30x: URL redirection */ - entry->Flags |= CA_Redirect; - if (header[11] == '1') - entry->Flags |= CA_ForceRedirect; /* 301 Moved Permanently */ - else if (header[11] == '2') - entry->Flags |= CA_TempRedirect; /* 302 Temporal Redirect */ - - location_str = Cache_parse_field(header, "Location"); - entry->Location = a_Url_new(location_str, URL_STR_(entry->Url), 0, 0, 0); - dFree(location_str); - - } else if (strncmp(header + 9, "404", 3) == 0) { - entry->Flags |= CA_NotFound; + if (HdrLen > 12) { + if (header[9] == '3' && header[10] == '0') { + /* 30x: URL redirection */ + entry->Flags |= CA_Redirect; + if (header[11] == '1') + entry->Flags |= CA_ForceRedirect; /* 301 Moved Permanently */ + else if (header[11] == '2') + entry->Flags |= CA_TempRedirect; /* 302 Temporary Redirect */ + + location_str = Cache_parse_field(header, "Location"); + entry->Location = a_Url_new(location_str, URL_STR_(entry->Url), 0, 0, 0); + dFree(location_str); + + } else if (strncmp(header + 9, "404", 3) == 0) { + entry->Flags |= CA_NotFound; + } } if ((Length = Cache_parse_field(header, "Content-Length")) != NULL) { |