comparison src/http/ngx_http_request.c @ 1373:fdea12ffb24a

discard request body before going to keep-alive state and use lingering timeouts
author Igor Sysoev <igor@sysoev.ru>
date Tue, 07 Aug 2007 10:53:27 +0000
parents 202cae9a0c2b
children cb8b30ef3e7e
comparison
equal deleted inserted replaced
1372:2cc9b6651f75 1373:fdea12ffb24a
1919 ngx_http_core_loc_conf_t *clcf; 1919 ngx_http_core_loc_conf_t *clcf;
1920 1920
1921 c = r->connection; 1921 c = r->connection;
1922 rev = c->read; 1922 rev = c->read;
1923 1923
1924 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
1925
1924 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "set http keepalive handler"); 1926 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "set http keepalive handler");
1927
1928 if (r->discard_body) {
1929 r->lingering_time = ngx_time() + (time_t) (clcf->lingering_time / 1000);
1930 ngx_add_timer(rev, clcf->lingering_timeout);
1931 return;
1932 }
1925 1933
1926 c->log->action = "closing request"; 1934 c->log->action = "closing request";
1927 1935
1928 hc = r->http_connection; 1936 hc = r->http_connection;
1929 b = r->header_in; 1937 b = r->header_in;
1963 1971
1964 hc->busy[0] = b; 1972 hc->busy[0] = b;
1965 hc->nbusy = 1; 1973 hc->nbusy = 1;
1966 } 1974 }
1967 } 1975 }
1968
1969 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
1970 1976
1971 ngx_http_request_done(r, 0); 1977 ngx_http_request_done(r, 0);
1972 1978
1973 c->data = hc; 1979 c->data = hc;
1974 1980