Klaus Demo nginx / 0bd7b00
ignore EINVAL from setsockopt() on Solaris Igor Sysoev 13 years ago
3 changed file(s) with 19 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
781781 {
782782 ngx_uint_t level;
783783
784 if (err == NGX_ECONNRESET
785 && c->log_error == NGX_ERROR_IGNORE_ECONNRESET)
786 {
784 if (err == NGX_ECONNRESET && c->log_error == NGX_ERROR_IGNORE_ECONNRESET) {
787785 return 0;
788786 }
787
788 #if (NGX_SOLARIS)
789 if (err == NGX_EINVAL && c->log_error == NGX_ERROR_IGNORE_EINVAL) {
790 return 0;
791 }
792 #endif
789793
790794 if (err == 0
791795 || err == NGX_ECONNRESET
802806 {
803807 switch (c->log_error) {
804808
809 case NGX_ERROR_IGNORE_EINVAL:
805810 case NGX_ERROR_IGNORE_ECONNRESET:
806811 case NGX_ERROR_INFO:
807812 level = NGX_LOG_INFO;
6868
6969
7070 typedef enum {
71 NGX_ERROR_CRIT = 0,
71 NGX_ERROR_ALERT = 0,
7272 NGX_ERROR_ERR,
7373 NGX_ERROR_INFO,
74 NGX_ERROR_IGNORE_ECONNRESET
74 NGX_ERROR_IGNORE_ECONNRESET,
75 NGX_ERROR_IGNORE_EINVAL
7576 } ngx_connection_log_error_e;
7677
7778
130131
131132 unsigned buffered:8;
132133
133 unsigned log_error:2; /* ngx_connection_log_error_e */
134 unsigned log_error:3; /* ngx_connection_log_error_e */
134135
135136 unsigned single_connection:1;
136137 unsigned unexpected_eof:1;
24202420 (const void *) &tcp_nodelay, sizeof(int))
24212421 == -1)
24222422 {
2423 #if (NGX_SOLARIS)
2424 /* Solaris returns EINVAL if a socket has been shut down */
2425 c->log_error = NGX_ERROR_IGNORE_EINVAL;
2426 #endif
2427
24232428 ngx_connection_error(c, ngx_socket_errno,
24242429 "setsockopt(TCP_NODELAY) failed");
2430
2431 c->log_error = NGX_ERROR_INFO;
24252432 ngx_http_close_connection(c);
24262433 return;
24272434 }