comparison src/core/ngx_connection.c @ 460:bb941a2996a6 NGINX_0_7_42

nginx 0.7.42 *) Change: now the "Invalid argument" error returned by setsockopt(TCP_NODELAY) on Solaris, is ignored. *) Change: now if a file specified in a "auth_basic_user_file" directive is absent, then the 405 error is returned instead of the 500 one. *) Feature: the "auth_basic_user_file" directive supports variables. Thanks to Kirill A. Korinskiy. *) Feature: the "listen" directive supports the "ipv6only" parameter. Thanks to Zhang Hua. *) Bugfix: in an "alias" directive with references to captures of regular expressions; the bug had appeared in 0.7.40. *) Bugfix: compatibility with Tru64 UNIX. Thanks to Dustin Marquess. *) Bugfix: nginx could not be built without PCRE library; the bug had appeared in 0.7.41.
author Igor Sysoev <http://sysoev.ru>
date Mon, 16 Mar 2009 00:00:00 +0300
parents 76a79816b771
children 549994537f15
comparison
equal deleted inserted replaced
459:6ef558ffc0eb 460:bb941a2996a6
280 } 280 }
281 281
282 return NGX_ERROR; 282 return NGX_ERROR;
283 } 283 }
284 284
285 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
286
287 if (ls[i].sockaddr->sa_family == AF_INET6 && ls[i].ipv6only) {
288 int ipv6only;
289
290 ipv6only = (ls[i].ipv6only == 1);
291
292 if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
293 (const void *) &ipv6only, sizeof(int))
294 == -1)
295 {
296 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_socket_errno,
297 "setsockopt(IPV6_V6ONLY) %V failed, ignored",
298 &ls[i].addr_text);
299 }
300 }
301 #endif
285 /* TODO: close on exit */ 302 /* TODO: close on exit */
286 303
287 if (!(ngx_event_flags & NGX_USE_AIO_EVENT)) { 304 if (!(ngx_event_flags & NGX_USE_AIO_EVENT)) {
288 if (ngx_nonblocking(s) == -1) { 305 if (ngx_nonblocking(s) == -1) {
289 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, 306 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,
780 ngx_int_t 797 ngx_int_t
781 ngx_connection_error(ngx_connection_t *c, ngx_err_t err, char *text) 798 ngx_connection_error(ngx_connection_t *c, ngx_err_t err, char *text)
782 { 799 {
783 ngx_uint_t level; 800 ngx_uint_t level;
784 801
785 if (err == NGX_ECONNRESET 802 if (err == NGX_ECONNRESET && c->log_error == NGX_ERROR_IGNORE_ECONNRESET) {
786 && c->log_error == NGX_ERROR_IGNORE_ECONNRESET)
787 {
788 return 0; 803 return 0;
789 } 804 }
805
806 #if (NGX_SOLARIS)
807 if (err == NGX_EINVAL && c->log_error == NGX_ERROR_IGNORE_EINVAL) {
808 return 0;
809 }
810 #endif
790 811
791 if (err == 0 812 if (err == 0
792 || err == NGX_ECONNRESET 813 || err == NGX_ECONNRESET
793 #if !(NGX_WIN32) 814 #if !(NGX_WIN32)
794 || err == NGX_EPIPE 815 || err == NGX_EPIPE
801 || err == NGX_EHOSTDOWN 822 || err == NGX_EHOSTDOWN
802 || err == NGX_EHOSTUNREACH) 823 || err == NGX_EHOSTUNREACH)
803 { 824 {
804 switch (c->log_error) { 825 switch (c->log_error) {
805 826
827 case NGX_ERROR_IGNORE_EINVAL:
806 case NGX_ERROR_IGNORE_ECONNRESET: 828 case NGX_ERROR_IGNORE_ECONNRESET:
807 case NGX_ERROR_INFO: 829 case NGX_ERROR_INFO:
808 level = NGX_LOG_INFO; 830 level = NGX_LOG_INFO;
809 break; 831 break;
810 832