Mercurial > hg > nginx-vendor-0-6
comparison src/http/ngx_http_postpone_filter_module.c @ 132:91372f004adf NGINX_0_3_13
nginx 0.3.13
*) Feature: the IMAP/POP3 proxy supports STARTTLS and STLS.
*) Bugfix: the IMAP/POP3 proxy did not work with the select, poll, and
/dev/poll methods.
*) Bugfix: in SSI handling.
*) Bugfix: now Solaris sendfilev() is not used to transfer the client
request body to FastCGI-server via the unix domain socket.
*) Bugfix: the "auth_basic" directive did not disable the
authorization; bug appeared in 0.3.11.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 05 Dec 2005 00:00:00 +0300 |
parents | 644a7935144b |
children | e1c6ac408b68 |
comparison
equal
deleted
inserted
replaced
131:add6b1e86d38 | 132:91372f004adf |
---|---|
7 #include <ngx_config.h> | 7 #include <ngx_config.h> |
8 #include <ngx_core.h> | 8 #include <ngx_core.h> |
9 #include <ngx_http.h> | 9 #include <ngx_http.h> |
10 | 10 |
11 | 11 |
12 static ngx_int_t | |
13 ngx_http_postpone_filter_output_postponed_request(ngx_http_request_t *r); | |
12 static ngx_int_t ngx_http_postpone_filter_init(ngx_cycle_t *cycle); | 14 static ngx_int_t ngx_http_postpone_filter_init(ngx_cycle_t *cycle); |
13 | 15 |
14 | 16 |
15 static ngx_http_module_t ngx_http_postpone_filter_module_ctx = { | 17 static ngx_http_module_t ngx_http_postpone_filter_module_ctx = { |
16 NULL, /* preconfiguration */ | 18 NULL, /* preconfiguration */ |
51 { | 53 { |
52 ngx_int_t rc; | 54 ngx_int_t rc; |
53 ngx_chain_t *out; | 55 ngx_chain_t *out; |
54 ngx_http_postponed_request_t *pr, **ppr; | 56 ngx_http_postponed_request_t *pr, **ppr; |
55 | 57 |
56 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 58 ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
57 "http postpone filter \"%V\" %p", &r->uri, in); | 59 "http postpone filter \"%V?%V\" %p", &r->uri, &r->args, in); |
58 | 60 |
59 if (r != r->connection->data || (r->postponed && in)) { | 61 if (r != r->connection->data || (r->postponed && in)) { |
60 | 62 |
61 if (r->postponed) { | 63 if (r->postponed) { |
62 for (pr = r->postponed; pr->next; pr = pr->next) { /* void */ } | 64 for (pr = r->postponed; pr->next; pr = pr->next) { /* void */ } |
102 | 104 |
103 if (out == NULL && r->main->out == NULL && !r->main->connection->buffered) { | 105 if (out == NULL && r->main->out == NULL && !r->main->connection->buffered) { |
104 return NGX_OK; | 106 return NGX_OK; |
105 } | 107 } |
106 | 108 |
107 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 109 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
108 "http postpone filter out \"%V\"", &r->uri); | 110 "http postpone filter out \"%V?%V\"", &r->uri, &r->args); |
109 | 111 |
110 rc = ngx_http_next_filter(r->main, out); | 112 rc = ngx_http_next_filter(r->main, out); |
111 | 113 |
112 if (rc == NGX_ERROR) { | 114 if (rc == NGX_ERROR) { |
113 /* NGX_ERROR may be returned by any filter */ | 115 /* NGX_ERROR may be returned by any filter */ |
114 r->connection->closed = 1; | 116 r->connection->error = 1; |
117 } | |
118 | |
119 if (r->postponed == NULL) { | |
120 return rc; | |
121 } | |
122 | |
123 rc = ngx_http_postpone_filter_output_postponed_request(r); | |
124 | |
125 if (rc == NGX_ERROR) { | |
126 /* NGX_ERROR may be returned by any filter */ | |
127 r->connection->error = 1; | |
115 } | 128 } |
116 | 129 |
117 return rc; | 130 return rc; |
131 } | |
132 | |
133 | |
134 static ngx_int_t | |
135 ngx_http_postpone_filter_output_postponed_request(ngx_http_request_t *r) | |
136 { | |
137 ngx_int_t rc; | |
138 ngx_http_postponed_request_t *pr; | |
139 | |
140 for ( ;; ) { | |
141 pr = r->postponed; | |
142 | |
143 if (pr == NULL) { | |
144 return NGX_OK; | |
145 } | |
146 | |
147 if (pr->request) { | |
148 | |
149 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | |
150 "http postpone filter handle \"%V?%V\"", | |
151 &pr->request->uri, &pr->request->args); | |
152 | |
153 if (!pr->request->done) { | |
154 r->connection->data = pr->request; | |
155 return NGX_AGAIN; | |
156 } | |
157 | |
158 rc = ngx_http_postpone_filter_output_postponed_request(pr->request); | |
159 | |
160 if (rc == NGX_AGAIN || rc == NGX_ERROR) { | |
161 return rc; | |
162 } | |
163 | |
164 r->postponed = r->postponed->next; | |
165 pr = r->postponed; | |
166 } | |
167 | |
168 if (pr->out) { | |
169 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | |
170 "http postpone filter out postponed \"%V?%V\"", | |
171 &r->uri, &r->args); | |
172 | |
173 if (ngx_http_next_filter(r->main, pr->out) == NGX_ERROR) { | |
174 return NGX_ERROR; | |
175 } | |
176 } | |
177 | |
178 r->postponed = r->postponed->next; | |
179 } | |
118 } | 180 } |
119 | 181 |
120 | 182 |
121 static ngx_int_t | 183 static ngx_int_t |
122 ngx_http_postpone_filter_init(ngx_cycle_t *cycle) | 184 ngx_http_postpone_filter_init(ngx_cycle_t *cycle) |