comparison src/http/ngx_http_core_module.c @ 348:e10168d6e371 NGINX_0_6_18

nginx 0.6.18 *) Change: now the ngx_http_userid_module adds start time microseconds to the cookie field contains a pid value. *) Change: now the full request line instead of URI only is written to error_log. *) Feature: variables support in the "proxy_pass" directive. *) Feature: the "resolver" and "resolver_timeout" directives. *) Feature: now the directive "add_header last-modified ''" deletes a "Last-Modified" response header line. *) Bugfix: the "limit_rate" directive did not allow to use full throughput, even if limit value was very high.
author Igor Sysoev <http://sysoev.ru>
date Tue, 27 Nov 2007 00:00:00 +0300
parents 4276c2f1f434
children 583decdb82a4
comparison
equal deleted inserted replaced
347:d53199b68e17 348:e10168d6e371
67 void *conf); 67 void *conf);
68 static char *ngx_http_core_keepalive(ngx_conf_t *cf, ngx_command_t *cmd, 68 static char *ngx_http_core_keepalive(ngx_conf_t *cf, ngx_command_t *cmd,
69 void *conf); 69 void *conf);
70 static char *ngx_http_core_internal(ngx_conf_t *cf, ngx_command_t *cmd, 70 static char *ngx_http_core_internal(ngx_conf_t *cf, ngx_command_t *cmd,
71 void *conf); 71 void *conf);
72 static char * ngx_http_core_resolver(ngx_conf_t *cf, ngx_command_t *cmd,
73 void *conf);
72 74
73 static char *ngx_http_core_lowat_check(ngx_conf_t *cf, void *post, void *data); 75 static char *ngx_http_core_lowat_check(ngx_conf_t *cf, void *post, void *data);
74 static char *ngx_http_core_pool_size(ngx_conf_t *cf, void *post, void *data); 76 static char *ngx_http_core_pool_size(ngx_conf_t *cf, void *post, void *data);
75 77
76 static ngx_conf_post_t ngx_http_core_lowat_post = 78 static ngx_conf_post_t ngx_http_core_lowat_post =
488 { ngx_string("open_file_cache_events"), 490 { ngx_string("open_file_cache_events"),
489 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, 491 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
490 ngx_conf_set_flag_slot, 492 ngx_conf_set_flag_slot,
491 NGX_HTTP_LOC_CONF_OFFSET, 493 NGX_HTTP_LOC_CONF_OFFSET,
492 offsetof(ngx_http_core_loc_conf_t, open_file_cache_events), 494 offsetof(ngx_http_core_loc_conf_t, open_file_cache_events),
495 NULL },
496
497 { ngx_string("resolver"),
498 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
499 ngx_http_core_resolver,
500 NGX_HTTP_LOC_CONF_OFFSET,
501 0,
502 NULL },
503
504 { ngx_string("resolver_timeout"),
505 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
506 ngx_conf_set_msec_slot,
507 NGX_HTTP_LOC_CONF_OFFSET,
508 offsetof(ngx_http_core_loc_conf_t, resolver_timeout),
493 NULL }, 509 NULL },
494 510
495 ngx_null_command 511 ngx_null_command
496 }; 512 };
497 513
2389 lcf->limit_rate = NGX_CONF_UNSET_SIZE; 2405 lcf->limit_rate = NGX_CONF_UNSET_SIZE;
2390 lcf->keepalive_timeout = NGX_CONF_UNSET_MSEC; 2406 lcf->keepalive_timeout = NGX_CONF_UNSET_MSEC;
2391 lcf->keepalive_header = NGX_CONF_UNSET; 2407 lcf->keepalive_header = NGX_CONF_UNSET;
2392 lcf->lingering_time = NGX_CONF_UNSET_MSEC; 2408 lcf->lingering_time = NGX_CONF_UNSET_MSEC;
2393 lcf->lingering_timeout = NGX_CONF_UNSET_MSEC; 2409 lcf->lingering_timeout = NGX_CONF_UNSET_MSEC;
2410 lcf->resolver_timeout = NGX_CONF_UNSET_MSEC;
2394 lcf->reset_timedout_connection = NGX_CONF_UNSET; 2411 lcf->reset_timedout_connection = NGX_CONF_UNSET;
2395 lcf->port_in_redirect = NGX_CONF_UNSET; 2412 lcf->port_in_redirect = NGX_CONF_UNSET;
2396 lcf->msie_padding = NGX_CONF_UNSET; 2413 lcf->msie_padding = NGX_CONF_UNSET;
2397 lcf->msie_refresh = NGX_CONF_UNSET; 2414 lcf->msie_refresh = NGX_CONF_UNSET;
2398 lcf->log_not_found = NGX_CONF_UNSET; 2415 lcf->log_not_found = NGX_CONF_UNSET;
2570 prev->keepalive_header, 0); 2587 prev->keepalive_header, 0);
2571 ngx_conf_merge_msec_value(conf->lingering_time, 2588 ngx_conf_merge_msec_value(conf->lingering_time,
2572 prev->lingering_time, 30000); 2589 prev->lingering_time, 30000);
2573 ngx_conf_merge_msec_value(conf->lingering_timeout, 2590 ngx_conf_merge_msec_value(conf->lingering_timeout,
2574 prev->lingering_timeout, 5000); 2591 prev->lingering_timeout, 5000);
2592 ngx_conf_merge_msec_value(conf->resolver_timeout,
2593 prev->resolver_timeout, 30000);
2594
2595 if (conf->resolver == NULL) {
2596 conf->resolver = prev->resolver;
2597 }
2575 2598
2576 ngx_conf_merge_path_value(conf->client_body_temp_path, 2599 ngx_conf_merge_path_value(conf->client_body_temp_path,
2577 prev->client_body_temp_path, 2600 prev->client_body_temp_path,
2578 NGX_HTTP_CLIENT_TEMP_PATH, 0, 0, 0, 2601 NGX_HTTP_CLIENT_TEMP_PATH, 0, 0, 0,
2579 ngx_garbage_collector_temp_handler, cf); 2602 ngx_garbage_collector_temp_handler, cf);
3359 return NGX_CONF_OK; 3382 return NGX_CONF_OK;
3360 } 3383 }
3361 3384
3362 3385
3363 static char * 3386 static char *
3387 ngx_http_core_resolver(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
3388 {
3389 ngx_http_core_loc_conf_t *clcf = conf;
3390
3391 ngx_url_t u;
3392 ngx_str_t *value;
3393
3394 value = cf->args->elts;
3395
3396 u.host = value[1];
3397 u.port = 53;
3398
3399 if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) {
3400 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%V: %s", &u.host, u.err);
3401 return NGX_CONF_ERROR;
3402 }
3403
3404 clcf->resolver = ngx_resolver_create(&u.addrs[0], cf->cycle->new_log);
3405 if (clcf->resolver == NULL) {
3406 return NGX_OK;
3407 }
3408
3409 return NGX_CONF_OK;
3410 }
3411
3412
3413 static char *
3364 ngx_http_core_lowat_check(ngx_conf_t *cf, void *post, void *data) 3414 ngx_http_core_lowat_check(ngx_conf_t *cf, void *post, void *data)
3365 { 3415 {
3366 #if (NGX_FREEBSD) 3416 #if (NGX_FREEBSD)
3367 ssize_t *np = data; 3417 ssize_t *np = data;
3368 3418