| #define NGX_HTTP_CACHE_ENTRY_DELETED 0x00000001 |
| #define NGX_HTTP_CACHE_ENTRY_MMAPED 0x00000002 |
| /* "/" -> "/index.html" in ngx_http_index_handler */ |
| #define NGX_HTTP_CACHE_ENTRY_URI 0x00000004 |
| #define NGX_HTTP_CACHE_FILTER_FLAGS 0xFFFF0000 |
| time_t updated; /* no needed with kqueue */ |
| } ngx_http_cache_entry_t; |
| } ngx_http_cache_hash_entry_t; |
| } ngx_http_cache_handle_t; |
| int ngx_http_cache_get(ngx_http_cache_hash_t *cache_hash, |
| ngx_str_t *uri, ngx_http_cache_handle_t *h) |
| ngx_http_cache_hash_entry_t *entry; |
| h->crc = ngx_crc32(uri->data, uri->len); |
| hi = h->crc % cache_hash->size; |
| entry = cache_hash[hi].elts; |
| for (i = 0; i < cache_hash[hi].nelts; i++) { |
| && entry[i].uri.len == uri->len |
| && ngx_strncmp(entry[i].uri.data, uri->data, uri->len) == 0 |
| h->cache = entry[i].cache; |