comparison src/http/ngx_http_core_module.c @ 300:cba14c1e2a4b NGINX_0_5_20

nginx 0.5.20 *) Feature: the "sendfile_max_chunk" directive. *) Feature: the "$http_...", "$sent_http_...", and "$upstream_http_..." variables may be changed using the "set" directive. *) Bugfix: a segmentation fault might occur in worker process if the SSI command 'if expr="$var = /"' was used. *) Bugfix: trailing boundary of multipart range response was transferred incorrectly. Thanks to Evan Miller. *) Bugfix: nginx did not work on Solaris/sparc64 if it was built by Sun Studio. Thanks to Andrei Nigmatulin. *) Bugfix: the ngx_http_perl_module could not built by Solaris make. Thanks to Andrei Nigmatulin.
author Igor Sysoev <http://sysoev.ru>
date Mon, 07 May 2007 00:00:00 +0400
parents 30862655219e
children 9b7db0df50f0
comparison
equal deleted inserted replaced
299:7d0d14dc5fd7 300:cba14c1e2a4b
68 void *conf); 68 void *conf);
69 static char *ngx_http_core_internal(ngx_conf_t *cf, ngx_command_t *cmd, 69 static char *ngx_http_core_internal(ngx_conf_t *cf, ngx_command_t *cmd,
70 void *conf); 70 void *conf);
71 71
72 static char *ngx_http_core_lowat_check(ngx_conf_t *cf, void *post, void *data); 72 static char *ngx_http_core_lowat_check(ngx_conf_t *cf, void *post, void *data);
73 static char *ngx_http_core_pool_size(ngx_conf_t *cf, void *post, void *data);
73 74
74 static ngx_conf_post_t ngx_http_core_lowat_post = 75 static ngx_conf_post_t ngx_http_core_lowat_post =
75 { ngx_http_core_lowat_check }; 76 { ngx_http_core_lowat_check };
77
78 static ngx_conf_post_handler_pt ngx_http_core_pool_size_p =
79 ngx_http_core_pool_size;
76 80
77 static ngx_conf_deprecated_t ngx_conf_deprecated_optimize_host_names = { 81 static ngx_conf_deprecated_t ngx_conf_deprecated_optimize_host_names = {
78 ngx_conf_deprecated, "optimize_host_names", "optimize_server_names" 82 ngx_conf_deprecated, "optimize_host_names", "optimize_server_names"
79 }; 83 };
80 84
127 { ngx_string("connection_pool_size"), 131 { ngx_string("connection_pool_size"),
128 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, 132 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
129 ngx_conf_set_size_slot, 133 ngx_conf_set_size_slot,
130 NGX_HTTP_SRV_CONF_OFFSET, 134 NGX_HTTP_SRV_CONF_OFFSET,
131 offsetof(ngx_http_core_srv_conf_t, connection_pool_size), 135 offsetof(ngx_http_core_srv_conf_t, connection_pool_size),
132 NULL }, 136 &ngx_http_core_pool_size_p },
133 137
134 { ngx_string("request_pool_size"), 138 { ngx_string("request_pool_size"),
135 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, 139 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
136 ngx_conf_set_size_slot, 140 ngx_conf_set_size_slot,
137 NGX_HTTP_SRV_CONF_OFFSET, 141 NGX_HTTP_SRV_CONF_OFFSET,
138 offsetof(ngx_http_core_srv_conf_t, request_pool_size), 142 offsetof(ngx_http_core_srv_conf_t, request_pool_size),
139 NULL }, 143 &ngx_http_core_pool_size_p },
140 144
141 { ngx_string("client_header_timeout"), 145 { ngx_string("client_header_timeout"),
142 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1, 146 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
143 ngx_conf_set_msec_slot, 147 ngx_conf_set_msec_slot,
144 NGX_HTTP_SRV_CONF_OFFSET, 148 NGX_HTTP_SRV_CONF_OFFSET,
291 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF 295 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
292 |NGX_CONF_TAKE1, 296 |NGX_CONF_TAKE1,
293 ngx_conf_set_flag_slot, 297 ngx_conf_set_flag_slot,
294 NGX_HTTP_LOC_CONF_OFFSET, 298 NGX_HTTP_LOC_CONF_OFFSET,
295 offsetof(ngx_http_core_loc_conf_t, sendfile), 299 offsetof(ngx_http_core_loc_conf_t, sendfile),
300 NULL },
301
302 { ngx_string("sendfile_max_chunk"),
303 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
304 ngx_conf_set_size_slot,
305 NGX_HTTP_LOC_CONF_OFFSET,
306 offsetof(ngx_http_core_loc_conf_t, sendfile_max_chunk),
296 NULL }, 307 NULL },
297 308
298 { ngx_string("tcp_nopush"), 309 { ngx_string("tcp_nopush"),
299 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG, 310 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
300 ngx_conf_set_flag_slot, 311 ngx_conf_set_flag_slot,
2189 lcf->client_body_timeout = NGX_CONF_UNSET_MSEC; 2200 lcf->client_body_timeout = NGX_CONF_UNSET_MSEC;
2190 lcf->satisfy_any = NGX_CONF_UNSET; 2201 lcf->satisfy_any = NGX_CONF_UNSET;
2191 lcf->internal = NGX_CONF_UNSET; 2202 lcf->internal = NGX_CONF_UNSET;
2192 lcf->client_body_in_file_only = NGX_CONF_UNSET; 2203 lcf->client_body_in_file_only = NGX_CONF_UNSET;
2193 lcf->sendfile = NGX_CONF_UNSET; 2204 lcf->sendfile = NGX_CONF_UNSET;
2205 lcf->sendfile_max_chunk = NGX_CONF_UNSET_SIZE;
2194 lcf->tcp_nopush = NGX_CONF_UNSET; 2206 lcf->tcp_nopush = NGX_CONF_UNSET;
2195 lcf->tcp_nodelay = NGX_CONF_UNSET; 2207 lcf->tcp_nodelay = NGX_CONF_UNSET;
2196 lcf->send_timeout = NGX_CONF_UNSET_MSEC; 2208 lcf->send_timeout = NGX_CONF_UNSET_MSEC;
2197 lcf->send_lowat = NGX_CONF_UNSET_SIZE; 2209 lcf->send_lowat = NGX_CONF_UNSET_SIZE;
2198 lcf->postpone_output = NGX_CONF_UNSET_SIZE; 2210 lcf->postpone_output = NGX_CONF_UNSET_SIZE;
2357 ngx_conf_merge_value(conf->satisfy_any, prev->satisfy_any, 0); 2369 ngx_conf_merge_value(conf->satisfy_any, prev->satisfy_any, 0);
2358 ngx_conf_merge_value(conf->internal, prev->internal, 0); 2370 ngx_conf_merge_value(conf->internal, prev->internal, 0);
2359 ngx_conf_merge_value(conf->client_body_in_file_only, 2371 ngx_conf_merge_value(conf->client_body_in_file_only,
2360 prev->client_body_in_file_only, 0); 2372 prev->client_body_in_file_only, 0);
2361 ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0); 2373 ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0);
2374 ngx_conf_merge_size_value(conf->sendfile_max_chunk,
2375 prev->sendfile_max_chunk, 0);
2362 ngx_conf_merge_value(conf->tcp_nopush, prev->tcp_nopush, 0); 2376 ngx_conf_merge_value(conf->tcp_nopush, prev->tcp_nopush, 0);
2363 ngx_conf_merge_value(conf->tcp_nodelay, prev->tcp_nodelay, 1); 2377 ngx_conf_merge_value(conf->tcp_nodelay, prev->tcp_nodelay, 1);
2364 2378
2365 ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 60000); 2379 ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 60000);
2366 ngx_conf_merge_size_value(conf->send_lowat, prev->send_lowat, 0); 2380 ngx_conf_merge_size_value(conf->send_lowat, prev->send_lowat, 0);
3040 3054
3041 #endif 3055 #endif
3042 3056
3043 return NGX_CONF_OK; 3057 return NGX_CONF_OK;
3044 } 3058 }
3059
3060
3061 static char *
3062 ngx_http_core_pool_size(ngx_conf_t *cf, void *post, void *data)
3063 {
3064 size_t *sp = data;
3065
3066 if (*sp < NGX_MIN_POOL_SIZE) {
3067 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
3068 "pool must be no less than %uz", NGX_MIN_POOL_SIZE);
3069
3070 return NGX_CONF_ERROR;
3071 }
3072
3073 return NGX_CONF_OK;
3074 }