Mercurial > hg > nginx
changeset 2653:567028e737cc stable-0.6
r2561 merge:
ignore EINVAL from setsockopt() on Solaris
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 01 Apr 2009 16:42:09 +0000 |
parents | 2a06634cd7bf |
children | 96b878c984f4 |
files | src/core/ngx_connection.c src/core/ngx_connection.h src/http/ngx_http_request.c |
diffstat | 3 files changed, 19 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/core/ngx_connection.c Wed Apr 01 16:39:29 2009 +0000 +++ b/src/core/ngx_connection.c Wed Apr 01 16:42:09 2009 +0000 @@ -779,12 +779,16 @@ { ngx_uint_t level; - if (err == NGX_ECONNRESET - && c->log_error == NGX_ERROR_IGNORE_ECONNRESET) - { + if (err == NGX_ECONNRESET && c->log_error == NGX_ERROR_IGNORE_ECONNRESET) { return 0; } +#if (NGX_SOLARIS) + if (err == NGX_EINVAL && c->log_error == NGX_ERROR_IGNORE_EINVAL) { + return 0; + } +#endif + if (err == 0 || err == NGX_ECONNRESET #if !(NGX_WIN32) @@ -800,6 +804,7 @@ { switch (c->log_error) { + case NGX_ERROR_IGNORE_EINVAL: case NGX_ERROR_IGNORE_ECONNRESET: case NGX_ERROR_INFO: level = NGX_LOG_INFO;
--- a/src/core/ngx_connection.h Wed Apr 01 16:39:29 2009 +0000 +++ b/src/core/ngx_connection.h Wed Apr 01 16:42:09 2009 +0000 @@ -71,10 +71,11 @@ typedef enum { - NGX_ERROR_CRIT = 0, + NGX_ERROR_ALERT = 0, NGX_ERROR_ERR, NGX_ERROR_INFO, - NGX_ERROR_IGNORE_ECONNRESET + NGX_ERROR_IGNORE_ECONNRESET, + NGX_ERROR_IGNORE_EINVAL } ngx_connection_log_error_e; @@ -135,7 +136,7 @@ unsigned buffered:8; - unsigned log_error:2; /* ngx_connection_log_error_e */ + unsigned log_error:3; /* ngx_connection_log_error_e */ unsigned single_connection:1; unsigned unexpected_eof:1;
--- a/src/http/ngx_http_request.c Wed Apr 01 16:39:29 2009 +0000 +++ b/src/http/ngx_http_request.c Wed Apr 01 16:42:09 2009 +0000 @@ -2264,8 +2264,15 @@ (const void *) &tcp_nodelay, sizeof(int)) == -1) { +#if (NGX_SOLARIS) + /* Solaris returns EINVAL if a socket has been shut down */ + c->log_error = NGX_ERROR_IGNORE_EINVAL; +#endif + ngx_connection_error(c, ngx_socket_errno, "setsockopt(TCP_NODELAY) failed"); + + c->log_error = NGX_ERROR_INFO; ngx_http_close_connection(c); return; }