Klaus Demo nginx / 4f35368
merge r2889: keepalive_requests Igor Sysoev 13 years ago
4 changed file(s) with 22 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
133133
134134 ngx_atomic_uint_t number;
135135
136 ngx_uint_t requests;
137
136138 unsigned buffered:8;
137139
138140 unsigned log_error:3; /* ngx_connection_log_error_e */
425425 0,
426426 NULL },
427427
428 { ngx_string("keepalive_requests"),
429 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
430 ngx_conf_set_num_slot,
431 NGX_HTTP_LOC_CONF_OFFSET,
432 offsetof(ngx_http_core_loc_conf_t, keepalive_requests),
433 NULL },
434
428435 { ngx_string("satisfy"),
429436 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
430437 ngx_conf_set_enum_slot,
12931300 r->request_body_file_log_level = NGX_LOG_WARN;
12941301 }
12951302
1296 if (r->keepalive && clcf->keepalive_timeout == 0) {
1297 r->keepalive = 0;
1303 if (r->keepalive) {
1304 if (clcf->keepalive_timeout == 0) {
1305 r->keepalive = 0;
1306
1307 } else if (r->connection->requests >= clcf->keepalive_requests) {
1308 r->keepalive = 0;
1309 }
12981310 }
12991311
13001312 if (!clcf->tcp_nopush) {
29082920 lcf->limit_rate = NGX_CONF_UNSET_SIZE;
29092921 lcf->keepalive_timeout = NGX_CONF_UNSET_MSEC;
29102922 lcf->keepalive_header = NGX_CONF_UNSET;
2923 lcf->keepalive_requests = NGX_CONF_UNSET_UINT;
29112924 lcf->lingering_time = NGX_CONF_UNSET_MSEC;
29122925 lcf->lingering_timeout = NGX_CONF_UNSET_MSEC;
29132926 lcf->resolver_timeout = NGX_CONF_UNSET_MSEC;
31023115 prev->keepalive_timeout, 75000);
31033116 ngx_conf_merge_sec_value(conf->keepalive_header,
31043117 prev->keepalive_header, 0);
3118 ngx_conf_merge_uint_value(conf->keepalive_requests,
3119 prev->keepalive_requests, 100);
31053120 ngx_conf_merge_msec_value(conf->lingering_time,
31063121 prev->lingering_time, 30000);
31073122 ngx_conf_merge_msec_value(conf->lingering_timeout,
306306
307307 time_t keepalive_header; /* keepalive_timeout */
308308
309 ngx_uint_t keepalive_requests; /* keepalive_requests */
309310 ngx_uint_t satisfy; /* satisfy */
310311 ngx_uint_t if_modified_since; /* if_modified_since */
311312
252252 return;
253253 }
254254
255 c->requests++;
256
255257 hc = c->data;
256258
257259 if (hc == NULL) {