comparison src/http/ngx_http_core_module.c @ 342:4276c2f1f434 NGINX_0_6_15

nginx 0.6.15 *) Feature: cygwin compatibility. Thanks to Vladimir Kutakov. *) Feature: the "merge_slashes" directive. *) Feature: the "gzip_vary" directive. *) Feature: the "server_tokens" directive. *) Bugfix: nginx did not unescape URI in the "include" SSI command. *) Bugfix: the segmentation fault was occurred on start or while reconfiguration if variable was used in the "charset" or "source_charset" directives. *) Bugfix: nginx returned the 400 response on requests like "GET http://www.domain.com HTTP/1.0". Thanks to James Oakley. *) Bugfix: if request with request body was redirected using the "error_page" directive, then nginx tried to read the request body again; bug appeared in 0.6.7. *) Bugfix: a segmentation fault occurred in worker process if no server_name was explicitly defined for server processing request; bug appeared in 0.6.7.
author Igor Sysoev <http://sysoev.ru>
date Mon, 22 Oct 2007 00:00:00 +0400
parents 10cc350ed8a1
children e10168d6e371
comparison
equal deleted inserted replaced
341:183b4761fe5b 342:4276c2f1f434
183 ngx_conf_set_flag_slot, 183 ngx_conf_set_flag_slot,
184 NGX_HTTP_SRV_CONF_OFFSET, 184 NGX_HTTP_SRV_CONF_OFFSET,
185 offsetof(ngx_http_core_srv_conf_t, ignore_invalid_headers), 185 offsetof(ngx_http_core_srv_conf_t, ignore_invalid_headers),
186 NULL }, 186 NULL },
187 187
188 { ngx_string("merge_slashes"),
189 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
190 ngx_conf_set_flag_slot,
191 NGX_HTTP_SRV_CONF_OFFSET,
192 offsetof(ngx_http_core_srv_conf_t, merge_slashes),
193 NULL },
194
188 { ngx_string("location"), 195 { ngx_string("location"),
189 NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE12, 196 NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE12,
190 ngx_http_core_location, 197 ngx_http_core_location,
191 NGX_HTTP_SRV_CONF_OFFSET, 198 NGX_HTTP_SRV_CONF_OFFSET,
192 0, 199 0,
423 { ngx_string("recursive_error_pages"), 430 { ngx_string("recursive_error_pages"),
424 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, 431 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
425 ngx_conf_set_flag_slot, 432 ngx_conf_set_flag_slot,
426 NGX_HTTP_LOC_CONF_OFFSET, 433 NGX_HTTP_LOC_CONF_OFFSET,
427 offsetof(ngx_http_core_loc_conf_t, recursive_error_pages), 434 offsetof(ngx_http_core_loc_conf_t, recursive_error_pages),
435 NULL },
436
437 { ngx_string("server_tokens"),
438 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
439 ngx_conf_set_flag_slot,
440 NGX_HTTP_LOC_CONF_OFFSET,
441 offsetof(ngx_http_core_loc_conf_t, server_tokens),
428 NULL }, 442 NULL },
429 443
430 { ngx_string("error_page"), 444 { ngx_string("error_page"),
431 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF 445 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
432 |NGX_CONF_2MORE, 446 |NGX_CONF_2MORE,
679 && !r->discard_body 693 && !r->discard_body
680 && clcf->client_max_body_size 694 && clcf->client_max_body_size
681 && clcf->client_max_body_size < r->headers_in.content_length_n) 695 && clcf->client_max_body_size < r->headers_in.content_length_n)
682 { 696 {
683 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, 697 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
684 "client intented to send too large body: %O bytes", 698 "client intended to send too large body: %O bytes",
685 r->headers_in.content_length_n); 699 r->headers_in.content_length_n);
686 700
687 ngx_http_finalize_request(r, NGX_HTTP_REQUEST_ENTITY_TOO_LARGE); 701 ngx_http_finalize_request(r, NGX_HTTP_REQUEST_ENTITY_TOO_LARGE);
688 return NGX_OK; 702 return NGX_OK;
689 } 703 }
1596 1610
1597 return NGX_DONE; 1611 return NGX_DONE;
1598 } 1612 }
1599 1613
1600 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, 1614 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
1601 "could not find name location \"%V\"", name); 1615 "could not find named location \"%V\"", name);
1602 1616
1603 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); 1617 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
1604 return NGX_DONE; 1618 return NGX_DONE;
1605 } 1619 }
1606 1620
2231 cscf->request_pool_size = NGX_CONF_UNSET_SIZE; 2245 cscf->request_pool_size = NGX_CONF_UNSET_SIZE;
2232 cscf->client_header_timeout = NGX_CONF_UNSET_MSEC; 2246 cscf->client_header_timeout = NGX_CONF_UNSET_MSEC;
2233 cscf->client_header_buffer_size = NGX_CONF_UNSET_SIZE; 2247 cscf->client_header_buffer_size = NGX_CONF_UNSET_SIZE;
2234 cscf->optimize_server_names = NGX_CONF_UNSET; 2248 cscf->optimize_server_names = NGX_CONF_UNSET;
2235 cscf->ignore_invalid_headers = NGX_CONF_UNSET; 2249 cscf->ignore_invalid_headers = NGX_CONF_UNSET;
2250 cscf->merge_slashes = NGX_CONF_UNSET;
2236 2251
2237 return cscf; 2252 return cscf;
2238 } 2253 }
2239 2254
2240 2255
2290 sn = ngx_array_push(&conf->server_names); 2305 sn = ngx_array_push(&conf->server_names);
2291 if (sn == NULL) { 2306 if (sn == NULL) {
2292 return NGX_CONF_ERROR; 2307 return NGX_CONF_ERROR;
2293 } 2308 }
2294 2309
2310 #if (NGX_PCRE)
2311 sn->regex = NULL;
2312 #endif
2313 sn->core_srv_conf = conf;
2295 sn->name.len = conf->server_name.len; 2314 sn->name.len = conf->server_name.len;
2296 sn->name.data = conf->server_name.data; 2315 sn->name.data = conf->server_name.data;
2297 sn->core_srv_conf = conf;
2298 } 2316 }
2299 2317
2300 ngx_conf_merge_size_value(conf->connection_pool_size, 2318 ngx_conf_merge_size_value(conf->connection_pool_size,
2301 prev->connection_pool_size, 256); 2319 prev->connection_pool_size, 256);
2302 ngx_conf_merge_size_value(conf->request_pool_size, 2320 ngx_conf_merge_size_value(conf->request_pool_size,
2319 ngx_conf_merge_value(conf->optimize_server_names, 2337 ngx_conf_merge_value(conf->optimize_server_names,
2320 prev->optimize_server_names, 1); 2338 prev->optimize_server_names, 1);
2321 2339
2322 ngx_conf_merge_value(conf->ignore_invalid_headers, 2340 ngx_conf_merge_value(conf->ignore_invalid_headers,
2323 prev->ignore_invalid_headers, 1); 2341 prev->ignore_invalid_headers, 1);
2342
2343 ngx_conf_merge_value(conf->merge_slashes, prev->merge_slashes, 1);
2324 2344
2325 return NGX_CONF_OK; 2345 return NGX_CONF_OK;
2326 } 2346 }
2327 2347
2328 2348
2375 lcf->port_in_redirect = NGX_CONF_UNSET; 2395 lcf->port_in_redirect = NGX_CONF_UNSET;
2376 lcf->msie_padding = NGX_CONF_UNSET; 2396 lcf->msie_padding = NGX_CONF_UNSET;
2377 lcf->msie_refresh = NGX_CONF_UNSET; 2397 lcf->msie_refresh = NGX_CONF_UNSET;
2378 lcf->log_not_found = NGX_CONF_UNSET; 2398 lcf->log_not_found = NGX_CONF_UNSET;
2379 lcf->recursive_error_pages = NGX_CONF_UNSET; 2399 lcf->recursive_error_pages = NGX_CONF_UNSET;
2400 lcf->server_tokens = NGX_CONF_UNSET;
2380 lcf->types_hash_max_size = NGX_CONF_UNSET_UINT; 2401 lcf->types_hash_max_size = NGX_CONF_UNSET_UINT;
2381 lcf->types_hash_bucket_size = NGX_CONF_UNSET_UINT; 2402 lcf->types_hash_bucket_size = NGX_CONF_UNSET_UINT;
2382 lcf->open_file_cache = NGX_CONF_UNSET_PTR; 2403 lcf->open_file_cache = NGX_CONF_UNSET_PTR;
2383 lcf->open_file_cache_retest = NGX_CONF_UNSET; 2404 lcf->open_file_cache_retest = NGX_CONF_UNSET;
2384 lcf->open_file_cache_errors = NGX_CONF_UNSET; 2405 lcf->open_file_cache_errors = NGX_CONF_UNSET;
2563 ngx_conf_merge_value(conf->msie_padding, prev->msie_padding, 1); 2584 ngx_conf_merge_value(conf->msie_padding, prev->msie_padding, 1);
2564 ngx_conf_merge_value(conf->msie_refresh, prev->msie_refresh, 0); 2585 ngx_conf_merge_value(conf->msie_refresh, prev->msie_refresh, 0);
2565 ngx_conf_merge_value(conf->log_not_found, prev->log_not_found, 1); 2586 ngx_conf_merge_value(conf->log_not_found, prev->log_not_found, 1);
2566 ngx_conf_merge_value(conf->recursive_error_pages, 2587 ngx_conf_merge_value(conf->recursive_error_pages,
2567 prev->recursive_error_pages, 0); 2588 prev->recursive_error_pages, 0);
2589 ngx_conf_merge_value(conf->server_tokens, prev->server_tokens, 1);
2568 2590
2569 ngx_conf_merge_ptr_value(conf->open_file_cache, 2591 ngx_conf_merge_ptr_value(conf->open_file_cache,
2570 prev->open_file_cache, NULL); 2592 prev->open_file_cache, NULL);
2571 2593
2572 ngx_conf_merge_sec_value(conf->open_file_cache_retest, 2594 ngx_conf_merge_sec_value(conf->open_file_cache_retest,