comparison src/http/ngx_http_postpone_filter_module.c @ 144:e1c6ac408b68 NGINX_0_3_19

nginx 0.3.19 *) Feature: the "path" and "alias" directives support the variables. *) Change: now the "valid_referers" directive again checks the URI part. *) Bugfix: in SSI handling.
author Igor Sysoev <http://sysoev.ru>
date Wed, 28 Dec 2005 00:00:00 +0300
parents 91372f004adf
children 36af50a5582d
comparison
equal deleted inserted replaced
143:c2fa0caa07f2 144:e1c6ac408b68
100 100
101 } else { 101 } else {
102 out = in; 102 out = in;
103 } 103 }
104 104
105 if (out == NULL && r->main->out == NULL && !r->main->connection->buffered) { 105 rc = NGX_OK;
106 return NGX_OK;
107 }
108 106
109 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 107 if (out || r->main->out || r->main->connection->buffered) {
110 "http postpone filter out \"%V?%V\"", &r->uri, &r->args);
111 108
112 rc = ngx_http_next_filter(r->main, out); 109 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
110 "http postpone filter out \"%V?%V\"", &r->uri, &r->args);
113 111
114 if (rc == NGX_ERROR) { 112 if (!(out && out->next == NULL && ngx_buf_sync_only(out->buf))) {
115 /* NGX_ERROR may be returned by any filter */ 113
116 r->connection->error = 1; 114 rc = ngx_http_next_filter(r->main, out);
115
116 if (rc == NGX_ERROR) {
117 /* NGX_ERROR may be returned by any filter */
118 r->connection->error = 1;
119 }
120 }
117 } 121 }
118 122
119 if (r->postponed == NULL) { 123 if (r->postponed == NULL) {
120 return rc; 124 return rc;
121 } 125 }
133 137
134 static ngx_int_t 138 static ngx_int_t
135 ngx_http_postpone_filter_output_postponed_request(ngx_http_request_t *r) 139 ngx_http_postpone_filter_output_postponed_request(ngx_http_request_t *r)
136 { 140 {
137 ngx_int_t rc; 141 ngx_int_t rc;
142 ngx_chain_t *out;
138 ngx_http_postponed_request_t *pr; 143 ngx_http_postponed_request_t *pr;
139 144
140 for ( ;; ) { 145 for ( ;; ) {
141 pr = r->postponed; 146 pr = r->postponed;
142 147
163 168
164 r->postponed = r->postponed->next; 169 r->postponed = r->postponed->next;
165 pr = r->postponed; 170 pr = r->postponed;
166 } 171 }
167 172
168 if (pr->out) { 173 out = pr->out;
174
175 if (out) {
169 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 176 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
170 "http postpone filter out postponed \"%V?%V\"", 177 "http postpone filter out postponed \"%V?%V\"",
171 &r->uri, &r->args); 178 &r->uri, &r->args);
172 179
173 if (ngx_http_next_filter(r->main, pr->out) == NGX_ERROR) { 180 if (!(out && out->next == NULL && ngx_buf_sync_only(out->buf))) {
174 return NGX_ERROR; 181 if (ngx_http_next_filter(r->main, out) == NGX_ERROR) {
182 return NGX_ERROR;
183 }
175 } 184 }
176 } 185 }
177 186
178 r->postponed = r->postponed->next; 187 r->postponed = r->postponed->next;
179 } 188 }