comparison src/http/ngx_http_cache.c @ 189:c966c09be66b

nginx-0.0.1-2003-11-18-19:49:00 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 18 Nov 2003 16:49:00 +0000
parents c1f3a3c7c5db
children 02a715e85df1
comparison
equal deleted inserted replaced
188:0061d1f0908d 189:c966c09be66b
104 h = (ngx_http_cache_header_t *) ctx->buf->pos; 104 h = (ngx_http_cache_header_t *) ctx->buf->pos;
105 ctx->expires = h->expires; 105 ctx->expires = h->expires;
106 ctx->last_modified= h->last_modified; 106 ctx->last_modified= h->last_modified;
107 ctx->date = h->date; 107 ctx->date = h->date;
108 ctx->length = h->length; 108 ctx->length = h->length;
109
110 if (h->key_len > (size_t) (ctx->buf->last - ctx->buf->pos)) {
111 ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
112 "cache file \"%s\" is probably invalid",
113 ctx->file.name.data);
114 return NGX_DECLINED;
115 }
109 116
110 if (h->key_len != ctx->key.len 117 if (h->key_len != ctx->key.len
111 || ngx_strncmp(h->key, ctx->key.data, h->key_len) != 0) 118 || ngx_strncmp(h->key, ctx->key.data, h->key_len) != 0)
112 { 119 {
113 h->key[h->key_len] = '\0'; 120 h->key[h->key_len] = '\0';