comparison src/http/ngx_http_request.c @ 188:af37b7cb6698 NGINX_0_3_41

nginx 0.3.41 *) Feature: the -v switch. *) Bugfix: the segmentation fault may occurred if the SSI page has remote subrequests. *) Bugfix: in FastCGI handling. *) Bugfix: if the perl modules path was not set using --with-perl_modules_path=PATH or the "perl_modules", then the segmentation fault was occurred.
author Igor Sysoev <http://sysoev.ru>
date Fri, 21 Apr 2006 00:00:00 +0400
parents 54aabf2b0bc6
children 3689cd4e3228
comparison
equal deleted inserted replaced
187:c0ed72c62dfa 188:af37b7cb6698
1216 ngx_http_finalize_request(r, NGX_HTTP_LENGTH_REQUIRED); 1216 ngx_http_finalize_request(r, NGX_HTTP_LENGTH_REQUIRED);
1217 return NGX_ERROR; 1217 return NGX_ERROR;
1218 } 1218 }
1219 } 1219 }
1220 1220
1221 if (r->method == NGX_HTTP_POST && r->headers_in.content_length_n == -1) { 1221 if (r->method & (NGX_HTTP_POST|NGX_HTTP_PUT)
1222 && r->headers_in.content_length_n == -1)
1223 {
1222 ngx_log_error(NGX_LOG_INFO, r->connection->log, 0, 1224 ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
1223 "client sent POST method without \"Content-Length\" header"); 1225 "client sent POST method without \"Content-Length\" header");
1224 ngx_http_finalize_request(r, NGX_HTTP_LENGTH_REQUIRED); 1226 ngx_http_finalize_request(r, NGX_HTTP_LENGTH_REQUIRED);
1225 return NGX_ERROR; 1227 return NGX_ERROR;
1226 } 1228 }
1430 ngx_del_timer(r->connection->write); 1432 ngx_del_timer(r->connection->write);
1431 } 1433 }
1432 } 1434 }
1433 1435
1434 ngx_http_finalize_request(r, ngx_http_special_response_handler(r, rc)); 1436 ngx_http_finalize_request(r, ngx_http_special_response_handler(r, rc));
1435
1436 return; 1437 return;
1437 } 1438 }
1438 1439
1439 if (r != r->main || rc == NGX_AGAIN) { 1440 if (r != r->main || rc == NGX_AGAIN) {
1440 if (ngx_http_set_write_handler(r) != NGX_OK) { 1441 if (ngx_http_set_write_handler(r) != NGX_OK) {
2152 2153
2153 2154
2154 static void 2155 static void
2155 ngx_http_close_request(ngx_http_request_t *r, ngx_int_t error) 2156 ngx_http_close_request(ngx_http_request_t *r, ngx_int_t error)
2156 { 2157 {
2157 ngx_connection_t *c; 2158 ngx_connection_t *c;
2158 ngx_http_cleanup_t *cln;
2159 2159
2160 c = r->connection; 2160 c = r->connection;
2161 r = r->main; 2161
2162 2162 ngx_http_request_done(r->main, error);
2163 for (cln = r->cleanup; cln; cln = cln->next) {
2164 if (cln->handler) {
2165 cln->handler(cln->data);
2166 }
2167 }
2168
2169 ngx_http_request_done(r, error);
2170 ngx_http_close_connection(c); 2163 ngx_http_close_connection(c);
2171 } 2164 }
2172 2165
2173 2166
2174 static void 2167 static void
2175 ngx_http_request_done(ngx_http_request_t *r, ngx_int_t error) 2168 ngx_http_request_done(ngx_http_request_t *r, ngx_int_t error)
2176 { 2169 {
2177 ngx_log_t *log; 2170 ngx_log_t *log;
2178 ngx_uint_t i, n; 2171 ngx_uint_t i, n;
2179 struct linger linger; 2172 struct linger linger;
2173 ngx_http_cleanup_t *cln;
2180 ngx_http_log_ctx_t *ctx; 2174 ngx_http_log_ctx_t *ctx;
2181 ngx_http_handler_pt *log_handler; 2175 ngx_http_handler_pt *log_handler;
2182 ngx_http_core_loc_conf_t *clcf; 2176 ngx_http_core_loc_conf_t *clcf;
2183 ngx_http_core_main_conf_t *cmcf; 2177 ngx_http_core_main_conf_t *cmcf;
2184 2178
2187 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, "http close request"); 2181 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, "http close request");
2188 2182
2189 if (r->pool == NULL) { 2183 if (r->pool == NULL) {
2190 ngx_log_error(NGX_LOG_ALERT, log, 0, "http request already closed"); 2184 ngx_log_error(NGX_LOG_ALERT, log, 0, "http request already closed");
2191 return; 2185 return;
2186 }
2187
2188 for (cln = r->cleanup; cln; cln = cln->next) {
2189 if (cln->handler) {
2190 cln->handler(cln->data);
2191 }
2192 } 2192 }
2193 2193
2194 #if (NGX_STAT_STUB) 2194 #if (NGX_STAT_STUB)
2195 2195
2196 if (r->stat_reading) { 2196 if (r->stat_reading) {