}
ngx_add_timer(rev, c->listening->post_accept_timeout);
+ ngx_reusable_connection(c, 1);
if (ngx_handle_read_event(rev, 0) != NGX_OK) {
ngx_http_close_connection(c);
return;
}
+ if (c->close) {
+ ngx_http_close_connection(c);
+ return;
+ }
+
hc = c->data;
cscf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_core_module);
if (!rev->timer_set) {
ngx_add_timer(rev, c->listening->post_accept_timeout);
+ ngx_reusable_connection(c, 1);
}
if (ngx_handle_read_event(rev, 0) != NGX_OK) {
c->log->action = "reading client request line";
+ ngx_reusable_connection(c, 0);
+
c->data = ngx_http_create_request(c);
if (c->data == NULL) {
ngx_http_close_connection(c);
return;
}
+ if (c->close) {
+ ngx_http_close_connection(c);
+ return;
+ }
+
n = recv(c->fd, (char *) buf, 1, MSG_PEEK);
err = ngx_socket_errno;
if (!rev->timer_set) {
ngx_add_timer(rev, c->listening->post_accept_timeout);
+ ngx_reusable_connection(c, 1);
}
if (ngx_handle_read_event(rev, 0) != NGX_OK) {
ngx_add_timer(rev, c->listening->post_accept_timeout);
}
+ ngx_reusable_connection(c, 0);
+
c->ssl->handler = ngx_http_ssl_handshake_handler;
return;
}
c->read->handler = ngx_http_wait_request_handler;
/* STUB: epoll edge */ c->write->handler = ngx_http_empty_handler;
+ ngx_reusable_connection(c, 1);
+
ngx_http_wait_request_handler(c->read);
return;