comparison src/http/ngx_http_core_module.c @ 429:694cd6cdb714

nginx-0.0.11-2004-09-17-20:07:35 import
author Igor Sysoev <igor@sysoev.ru>
date Fri, 17 Sep 2004 16:07:35 +0000
parents 3f88935a02e8
children 8998b09f89e9
comparison
equal deleted inserted replaced
428:5e73d0ea4dab 429:694cd6cdb714
35 static char *ngx_set_server_name(ngx_conf_t *cf, ngx_command_t *cmd, 35 static char *ngx_set_server_name(ngx_conf_t *cf, ngx_command_t *cmd,
36 void *conf); 36 void *conf);
37 static char *ngx_set_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); 37 static char *ngx_set_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
38 static char *ngx_set_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); 38 static char *ngx_set_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
39 static char *ngx_set_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); 39 static char *ngx_set_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
40 static char *ngx_set_keepalive(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
40 41
41 static char *ngx_http_lowat_check(ngx_conf_t *cf, void *post, void *data); 42 static char *ngx_http_lowat_check(ngx_conf_t *cf, void *post, void *data);
42 43
43 static ngx_conf_post_t ngx_http_lowat_post = { ngx_http_lowat_check } ; 44 static ngx_conf_post_t ngx_http_lowat_post = { ngx_http_lowat_check } ;
44 45
225 NGX_HTTP_LOC_CONF_OFFSET, 226 NGX_HTTP_LOC_CONF_OFFSET,
226 offsetof(ngx_http_core_loc_conf_t, limit_rate), 227 offsetof(ngx_http_core_loc_conf_t, limit_rate),
227 NULL }, 228 NULL },
228 229
229 { ngx_string("keepalive_timeout"), 230 { ngx_string("keepalive_timeout"),
230 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, 231 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE12,
231 ngx_conf_set_msec_slot, 232 ngx_set_keepalive,
232 NGX_HTTP_LOC_CONF_OFFSET, 233 NGX_HTTP_LOC_CONF_OFFSET,
233 offsetof(ngx_http_core_loc_conf_t, keepalive_timeout), 234 0,
234 NULL }, 235 NULL },
235 236
236 { ngx_string("lingering_time"), 237 { ngx_string("lingering_time"),
237 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, 238 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
238 ngx_conf_set_msec_slot, 239 ngx_conf_set_msec_slot,
1368 lcf->send_lowat = NGX_CONF_UNSET_SIZE; 1369 lcf->send_lowat = NGX_CONF_UNSET_SIZE;
1369 lcf->postpone_output = NGX_CONF_UNSET_SIZE; 1370 lcf->postpone_output = NGX_CONF_UNSET_SIZE;
1370 lcf->limit_rate = NGX_CONF_UNSET_SIZE; 1371 lcf->limit_rate = NGX_CONF_UNSET_SIZE;
1371 lcf->discarded_buffer_size = NGX_CONF_UNSET_SIZE; 1372 lcf->discarded_buffer_size = NGX_CONF_UNSET_SIZE;
1372 lcf->keepalive_timeout = NGX_CONF_UNSET_MSEC; 1373 lcf->keepalive_timeout = NGX_CONF_UNSET_MSEC;
1374 lcf->keepalive_header = NGX_CONF_UNSET;
1373 lcf->lingering_time = NGX_CONF_UNSET_MSEC; 1375 lcf->lingering_time = NGX_CONF_UNSET_MSEC;
1374 lcf->lingering_timeout = NGX_CONF_UNSET_MSEC; 1376 lcf->lingering_timeout = NGX_CONF_UNSET_MSEC;
1375 lcf->reset_timedout_connection = NGX_CONF_UNSET; 1377 lcf->reset_timedout_connection = NGX_CONF_UNSET;
1376 lcf->msie_padding = NGX_CONF_UNSET; 1378 lcf->msie_padding = NGX_CONF_UNSET;
1377 1379
1455 1460); 1457 1460);
1456 ngx_conf_merge_size_value(conf->limit_rate, prev->limit_rate, 0); 1458 ngx_conf_merge_size_value(conf->limit_rate, prev->limit_rate, 0);
1457 ngx_conf_merge_size_value(conf->discarded_buffer_size, 1459 ngx_conf_merge_size_value(conf->discarded_buffer_size,
1458 prev->discarded_buffer_size, 1500); 1460 prev->discarded_buffer_size, 1500);
1459 ngx_conf_merge_msec_value(conf->keepalive_timeout, 1461 ngx_conf_merge_msec_value(conf->keepalive_timeout,
1460 prev->keepalive_timeout, 70000); 1462 prev->keepalive_timeout, 75000);
1463 ngx_conf_merge_sec_value(conf->keepalive_header,
1464 prev->keepalive_header, 0);
1461 ngx_conf_merge_msec_value(conf->lingering_time, 1465 ngx_conf_merge_msec_value(conf->lingering_time,
1462 prev->lingering_time, 30000); 1466 prev->lingering_time, 30000);
1463 ngx_conf_merge_msec_value(conf->lingering_timeout, 1467 ngx_conf_merge_msec_value(conf->lingering_timeout,
1464 prev->lingering_timeout, 5000); 1468 prev->lingering_timeout, 5000);
1465 1469
1709 1713
1710 return NGX_CONF_OK; 1714 return NGX_CONF_OK;
1711 } 1715 }
1712 1716
1713 1717
1718 static char *ngx_set_keepalive(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
1719 {
1720 ngx_http_core_loc_conf_t *lcf = conf;
1721
1722 ngx_str_t *value;
1723
1724 if (lcf->keepalive_timeout != NGX_CONF_UNSET_MSEC) {
1725 return "is duplicate";
1726 }
1727
1728 value = cf->args->elts;
1729
1730 lcf->keepalive_timeout = ngx_parse_time(&value[1], 0);
1731 if (lcf->keepalive_timeout == (ngx_msec_t) NGX_ERROR) {
1732 return "invalid value";
1733 }
1734
1735 if (lcf->keepalive_timeout == (ngx_msec_t) NGX_PARSE_LARGE_TIME) {
1736 return "value must be less than 597 hours";
1737 }
1738
1739 if (cf->args->nelts == 2) {
1740 return NGX_CONF_OK;
1741 }
1742
1743 lcf->keepalive_header = ngx_parse_time(&value[2], 1);
1744 if (lcf->keepalive_header == NGX_ERROR) {
1745 return "invalid value";
1746 }
1747
1748 if (lcf->keepalive_header == NGX_PARSE_LARGE_TIME) {
1749 return "value must be less than 68 years";
1750 }
1751
1752 return NGX_CONF_OK;
1753 }
1754
1755
1714 static char *ngx_set_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) 1756 static char *ngx_set_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
1715 { 1757 {
1716 ngx_http_core_loc_conf_t *lcf = conf; 1758 ngx_http_core_loc_conf_t *lcf = conf;
1717 1759
1718 if (!(lcf->err_log = ngx_log_create_errlog(cf->cycle, cf->args))) { 1760 if (!(lcf->err_log = ngx_log_create_errlog(cf->cycle, cf->args))) {