comparison src/http/ngx_http_upstream.c @ 757:a138c4e6031f

not do ngx_http_upstream_finalize_request() twice
author Igor Sysoev <igor@sysoev.ru>
date Tue, 10 Oct 2006 13:17:58 +0000
parents d904b5cb3bba
children 4ab852b691f5
comparison
equal deleted inserted replaced
756:d904b5cb3bba 757:a138c4e6031f
1135 } 1135 }
1136 1136
1137 umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module); 1137 umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module);
1138 1138
1139 if (r->upstream->headers_in.x_accel_redirect) { 1139 if (r->upstream->headers_in.x_accel_redirect) {
1140
1140 ngx_http_upstream_finalize_request(r, u, NGX_DECLINED); 1141 ngx_http_upstream_finalize_request(r, u, NGX_DECLINED);
1141 1142
1142 part = &r->upstream->headers_in.headers.part; 1143 part = &r->upstream->headers_in.headers.part;
1143 h = part->elts; 1144 h = part->elts;
1144 1145
1157 hh = ngx_hash_find(&umcf->headers_in_hash, h[i].hash, 1158 hh = ngx_hash_find(&umcf->headers_in_hash, h[i].hash,
1158 h[i].lowcase_key, h[i].key.len); 1159 h[i].lowcase_key, h[i].key.len);
1159 1160
1160 if (hh && hh->redirect) { 1161 if (hh && hh->redirect) {
1161 if (hh->copy_handler(r, &h[i], hh->conf) != NGX_OK) { 1162 if (hh->copy_handler(r, &h[i], hh->conf) != NGX_OK) {
1162 ngx_http_upstream_finalize_request(r, u, 1163 ngx_http_finalize_request(r,
1163 NGX_HTTP_INTERNAL_SERVER_ERROR); 1164 NGX_HTTP_INTERNAL_SERVER_ERROR);
1164 return; 1165 return;
1165 } 1166 }
1166 } 1167 }
1167 } 1168 }
1168 1169
1170 args.len = 0; 1171 args.len = 0;
1171 args.data = NULL; 1172 args.data = NULL;
1172 flags = 0; 1173 flags = 0;
1173 1174
1174 if (ngx_http_parse_unsafe_uri(r, uri, &args, &flags) != NGX_OK) { 1175 if (ngx_http_parse_unsafe_uri(r, uri, &args, &flags) != NGX_OK) {
1175 ngx_http_upstream_finalize_request(r, u, NGX_HTTP_NOT_FOUND); 1176 ngx_http_finalize_request(r, NGX_HTTP_NOT_FOUND);
1176 return; 1177 return;
1177 } 1178 }
1178 1179
1179 if (flags & NGX_HTTP_ZERO_IN_URI) { 1180 if (flags & NGX_HTTP_ZERO_IN_URI) {
1180 r->zero_in_uri = 1; 1181 r->zero_in_uri = 1;