annotate src/core/ngx_garbage_collector.c @ 190:02a715e85df1

nginx-0.0.1-2003-11-19-00:34:08 import
author Igor Sysoev <igor@sysoev.ru>
date Tue, 18 Nov 2003 21:34:08 +0000
parents c1f3a3c7c5db
children 2357fa41738a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
2 #include <ngx_config.h>
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
3 #include <ngx_core.h>
190
02a715e85df1 nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents: 186
diff changeset
4 #include <ngx_garbage_collector.h>
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
5
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
6
190
02a715e85df1 nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents: 186
diff changeset
7 int ngx_garbage_collector_temp_handler(ngx_gc_t *ctx, ngx_str_t *name,
02a715e85df1 nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents: 186
diff changeset
8 ngx_dir_t *dir);
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
9
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
10
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
11 static int ngx_collect_garbage(ngx_gc_t *ctx, ngx_str_t *dname, int level);
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
12
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
13
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
14
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
15 #if 0
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
16
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
17 {
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
18 ngx_test_null(cycle->timer_events,
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
19 ngx_alloc(sizeof(ngx_event_t) * TIMERS, cycle->log),
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
20 NGX_ERROR);
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
21
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
22 ngx_event_timer_init(cycle);
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
23 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
24
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
25
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
26 void garbage_collector()
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
27 {
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
28 ngx_msec_t timer;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
29 struct timeval tv;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
30 ngx_epoch_msec_t delta;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
31
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
32 for ( ;; ) {
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
33 timer = ngx_event_find_timer();
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
34
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
35 ngx_gettimeofday(&tv);
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
36 delta = tv.tv_sec * 1000 + tv.tv_usec / 1000;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
37
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
38 msleep(timer);
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
39
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
40 ngx_gettimeofday(&tv);
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
41
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
42 ngx_cached_time = tv.tv_sec;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
43 ngx_time_update();
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
44
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
45 delta = tv.tv_sec * 1000 + tv.tv_usec / 1000 - delta;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
46
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
47 ngx_event_expire_timers((ngx_msec_t) delta);
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
48 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
49 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
50
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
51 #endif
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
52
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
53
190
02a715e85df1 nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents: 186
diff changeset
54 void stub_init(ngx_cycle_t *cycle)
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
55 {
190
02a715e85df1 nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents: 186
diff changeset
56 int i;
02a715e85df1 nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents: 186
diff changeset
57 ngx_gc_t ctx;
02a715e85df1 nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents: 186
diff changeset
58 ngx_path_t **path;
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
59
190
02a715e85df1 nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents: 186
diff changeset
60 path = cycle->pathes.elts;
02a715e85df1 nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents: 186
diff changeset
61 for (i = 0; i < cycle->pathes.nelts; i++) {
02a715e85df1 nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents: 186
diff changeset
62 ctx.path = path[i];
02a715e85df1 nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents: 186
diff changeset
63 ctx.log = cycle->log;
02a715e85df1 nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents: 186
diff changeset
64 ctx.handler = path[i]->gc_handler;
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
65
190
02a715e85df1 nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents: 186
diff changeset
66 ngx_collect_garbage(&ctx, &path[i]->name, 0);
02a715e85df1 nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents: 186
diff changeset
67 }
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
68 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
69
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
70
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
71 static int ngx_collect_garbage(ngx_gc_t *ctx, ngx_str_t *dname, int level)
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
72 {
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
73 int rc, len;
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
74 char *last;
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
75 ngx_err_t err;
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
76 ngx_str_t fname, buf;
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
77 ngx_dir_t dir;
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
78
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
79 buf.len = 0;
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
80
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
81 ngx_log_debug(ctx->log, "dir '%s':%d" _ dname->data _ dname->len);
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
82
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
83 if (ngx_open_dir(dname, &dir) == NGX_ERROR) {
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
84 ngx_log_error(NGX_LOG_CRIT, ctx->log, ngx_errno,
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
85 ngx_open_dir_n " \"%s\" failed", dname->data);
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
86 return NGX_ERROR;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
87 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
88
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
89 for ( ;; ) {
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
90 ngx_set_errno(0);
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
91 if (ngx_read_dir(&dir) == NGX_ERROR) {
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
92 err = ngx_errno;
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
93
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
94 if (err != NGX_ENOMOREFILES) {
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
95 ngx_log_error(NGX_LOG_CRIT, ctx->log, err,
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
96 ngx_read_dir_n " \"%s\" failed", dname->data);
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
97 rc = NGX_ERROR;
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
98
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
99 } else {
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
100 rc = NGX_OK;
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
101 }
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
102
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
103 break;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
104 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
105
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
106 len = ngx_de_namelen(&dir);
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
107
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
108 ngx_log_debug(ctx->log, "name '%s':%d" _ ngx_de_name(&dir) _ len);
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
109
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
110 if (len == 1 && ngx_de_name(&dir)[0] == '.') {
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
111 continue;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
112 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
113
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
114 if (len == 2
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
115 && ngx_de_name(&dir)[0] == '.'
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
116 && ngx_de_name(&dir)[1] == '.')
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
117 {
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
118 continue;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
119 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
120
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
121 fname.len = dname->len + 1+ len;
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
122
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
123 if (fname.len + NGX_DIR_MASK_LEN > buf.len) {
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
124
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
125 if (buf.len) {
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
126 ngx_free(buf.data);
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
127 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
128
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
129 buf.len = dname->len + 1 + len + NGX_DIR_MASK_LEN;
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
130
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
131 if (!(buf.data = ngx_alloc(buf.len + 1, ctx->log))) {
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
132 return NGX_ABORT;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
133 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
134 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
135
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
136 last = ngx_cpymem(buf.data, dname->data, dname->len);
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
137 *last++ = '/';
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
138 ngx_memcpy(last, ngx_de_name(&dir), len + 1);
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
139 fname.data = buf.data;
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
140
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
141 ngx_log_debug(ctx->log, "path %s" _ fname.data);
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
142
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
143 if (!dir.info_valid) {
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
144 if (ngx_de_info(fname.data, &dir) == NGX_FILE_ERROR) {
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
145 ngx_log_error(NGX_LOG_CRIT, ctx->log, ngx_errno,
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
146 ngx_de_info_n " \"%s\" failed", fname.data);
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
147 continue;
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
148 }
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
149 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
150
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
151 if (ngx_de_is_dir(&dir)) {
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
152
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
153 ngx_log_debug(ctx->log, "enter %s" _ fname.data);
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
154
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
155 if (level == -1
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
156 /* there can not be directory on the last level */
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
157 || level == NGX_MAX_PATH_LEVEL
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
158 /* an directory from the old path hierarchy */
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
159 || len != ctx->path->level[level])
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
160 {
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
161 if (ngx_collect_garbage(ctx, &fname, -1) == NGX_ABORT) {
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
162 return NGX_ABORT;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
163 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
164
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
165 fname.data[fname.len] = '\0';
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
166
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
167 ngx_log_error(NGX_LOG_NOTICE, ctx->log, 0,
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
168 "delete old hierachy directory \"%s\"",
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
169 fname.data);
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
170
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
171 if (ngx_delete_dir(fname.data) == NGX_FILE_ERROR) {
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
172 ngx_log_error(NGX_LOG_CRIT, ctx->log, ngx_errno,
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
173 ngx_delete_dir_n " \"%s\" failed",
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
174 fname.data);
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
175 } else {
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
176 ctx->deleted++;
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
177 ctx->freed += ngx_de_size(&dir);
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
178 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
179
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
180 continue;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
181 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
182
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
183 if (ngx_collect_garbage(ctx, &fname, level + 1) == NGX_ABORT) {
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
184 return NGX_ABORT;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
185 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
186
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
187 } else if (ngx_de_is_file(&dir)) {
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
188
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
189 ngx_log_debug(ctx->log, "file %s" _ fname.data);
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
190
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
191 if (level == -1
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
192 || (level < NGX_MAX_PATH_LEVEL && ctx->path->level[level] != 0))
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
193 {
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
194 if (ngx_delete_file(fname.data) == NGX_FILE_ERROR) {
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
195 ngx_log_error(NGX_LOG_CRIT, ctx->log, ngx_errno,
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
196 ngx_delete_file_n " \"%s\" failed",
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
197 fname.data);
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
198 } else {
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
199 ctx->deleted++;
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
200 ctx->freed += ngx_de_size(&dir);
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
201 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
202
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
203 continue;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
204 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
205
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
206 if (ctx->handler(ctx, &fname, &dir) == NGX_ABORT) {
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
207 return NGX_ABORT;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
208 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
209
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
210 } else {
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
211 ngx_log_error(NGX_LOG_CRIT, ctx->log, ngx_errno,
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
212 "\"%s\" has unknown file type, deleting", fname.data);
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
213
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
214 if (ngx_delete_file(fname.data) == NGX_FILE_ERROR) {
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
215 ngx_log_error(NGX_LOG_CRIT, ctx->log, ngx_errno,
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
216 ngx_delete_file_n " \"%s\" failed", fname.data);
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
217 } else {
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
218 ctx->deleted++;
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
219 ctx->freed += ngx_de_size(&dir);
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
220 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
221 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
222 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
223
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
224 if (buf.len) {
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
225 ngx_free(buf.data);
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
226 }
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
227
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
228 if (ngx_close_dir(&dir) == NGX_ERROR) {
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
229 ngx_log_error(NGX_LOG_CRIT, ctx->log, ngx_errno,
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
230 ngx_close_dir_n " \"%s\" failed", fname.data);
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
231 }
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
232
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
233 return rc;
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
234 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
235
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
236
190
02a715e85df1 nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents: 186
diff changeset
237 int ngx_garbage_collector_temp_handler(ngx_gc_t *ctx, ngx_str_t *name,
02a715e85df1 nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents: 186
diff changeset
238 ngx_dir_t *dir)
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
239 {
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
240 /*
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
241 * we use mtime only and do not use atime because:
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
242 * on NTFS access time has a resolution of 1 hour,
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
243 * on NT FAT access time has a resolution of 1 day,
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
244 * Unices have mount option "noatime"
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
245 */
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
246
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
247 if (ngx_cached_time - ngx_de_mtime(dir) < 3600) {
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
248 return NGX_OK;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
249 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
250
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
251 ngx_log_error(NGX_LOG_NOTICE, ctx->log, 0,
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
252 "delete stale temporary \"%s\"", name->data);
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
253
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
254 if (ngx_delete_file(name->data) == NGX_FILE_ERROR) {
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
255 ngx_log_error(NGX_LOG_CRIT, ctx->log, ngx_errno,
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
256 ngx_delete_file_n " \"%s\" failed", name->data);
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
257 return NGX_ERROR;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
258 }
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
259
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
260 ctx->deleted++;
186
c1f3a3c7c5db nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents: 185
diff changeset
261 ctx->freed += ngx_de_size(dir);
190
02a715e85df1 nginx-0.0.1-2003-11-19-00:34:08 import
Igor Sysoev <igor@sysoev.ru>
parents: 186
diff changeset
262
185
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
263 return NGX_OK;
d5f50cefc322 nginx-0.0.1-2003-11-14-19:52:04 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
264 }