Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r5104 - trunk/src/http

Anonymous User
March 07, 2013 01:00PM
Author: vbart
Date: 2013-03-07 17:59:27 +0000 (Thu, 07 Mar 2013)
New Revision: 5104
URL: http://trac.nginx.org/nginx/changeset/5104/nginx

Log:
Respect the new behavior of TCP_DEFER_ACCEPT.

In Linux 2.6.32, TCP_DEFER_ACCEPT was changed to accept connections
after the deferring period is finished without any data available.
(Reading from the socket returns EAGAIN in this case.)

Since in nginx TCP_DEFER_ACCEPT is set to "post_accept_timeout", we
do not need to wait longer if deferred accept returns with no data.


Modified:
trunk/src/http/ngx_http_request.c

Modified: trunk/src/http/ngx_http_request.c
===================================================================
--- trunk/src/http/ngx_http_request.c 2013-03-07 17:41:40 UTC (rev 5103)
+++ trunk/src/http/ngx_http_request.c 2013-03-07 17:59:27 UTC (rev 5104)
@@ -416,6 +416,20 @@

if (n == NGX_AGAIN) {

+#if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT)
+ if (c->listening->deferred_accept
+#if (NGX_HTTP_SSL)
+ && c->ssl == NULL
+#endif
+ )
+ {
+ ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT,
+ "client timed out in deferred accept");
+ ngx_http_close_connection(c);
+ return;
+ }
+#endif
+
if (!rev->timer_set) {
ngx_add_timer(rev, c->listening->post_accept_timeout);
}
@@ -617,6 +631,15 @@
if (n == -1) {
if (err == NGX_EAGAIN) {

+#if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT)
+ if (c->listening->deferred_accept) {
+ ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT,
+ "client timed out in deferred accept");
+ ngx_http_close_connection(c);
+ return;
+ }
+#endif
+
if (!rev->timer_set) {
ngx_add_timer(rev, c->listening->post_accept_timeout);
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r5104 - trunk/src/http

Anonymous User 1030 March 07, 2013 01:00PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 214
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready