comparison src/http/ngx_http_cache.h @ 170:c42be4185301

nginx-0.0.1-2003-11-03-01:56:18 import
author Igor Sysoev <igor@sysoev.ru>
date Sun, 02 Nov 2003 22:56:18 +0000
parents
children aff0e5d32af8
comparison
equal deleted inserted replaced
169:edf29bb717da 170:c42be4185301
1 #ifndef _NGX_HTTP_CACHE_H_INCLUDED_
2 #define _NGX_HTTP_CACHE_H_INCLUDED_
3
4
5 #include <ngx_config.h>
6 #include <ngx_core.h>
7
8
9 typedef struct {
10 time_t expires;
11 time_t last_modified;
12 off_t length;
13
14 size_t size;
15 } ngx_http_cache_header_t;
16
17
18 typedef struct {
19 ssize_t type;
20 ngx_http_cache_header_t header;
21 ssize_t key_len;
22 char key[0];
23 } ngx_http_bin_cache_t;
24
25
26 typedef struct {
27 char type;
28 char space0;
29 char expires[8];
30 char space1;
31 char last_modified[8];
32 char space2;
33 char length[16];
34 char space3;
35 char lf;
36 char key_len[0];
37 } ngx_http_text_cache_t;
38
39
40 typedef struct {
41 u_int32_t crc;
42 ngx_str_t key;
43 ngx_fd_t fd;
44 off_t size;
45 void *data; /* mmap, memory */
46 time_t accessed;
47 time_t last_modified;
48 time_t updated; /* no needed with kqueue */
49 int refs;
50 int flags;
51 } ngx_http_cache_entry_t;
52
53
54 typedef struct {
55 ngx_file_t file;
56 ngx_str_t key;
57 ngx_path_t *path;
58 ngx_hunk_t *buf;
59 ngx_http_cache_header_t header;
60 } ngx_http_cache_ctx_t;
61
62
63 int ngx_http_cache_get_file(ngx_http_request_t *r, ngx_http_cache_ctx_t *ctx);
64 int ngx_http_cache_update_file(ngx_http_request_t *r,ngx_http_cache_ctx_t *ctx,
65 ngx_str_t *temp_file);
66
67
68
69
70
71 #endif /* _NGX_HTTP_CACHE_H_INCLUDED_ */