Mercurial > hg > nginx-quic
comparison src/core/ngx_cycle.c @ 3569:8bb6ce44672a
*) delete no longer used unix domain sockets
*) fix unix domain socket comparison
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 04 Jun 2010 13:34:23 +0000 |
parents | ab353d7dc182 |
children | 99b2da73c29d |
comparison
equal
deleted
inserted
replaced
3568:7cfbc51bac01 | 3569:8bb6ce44672a |
---|---|
664 if (ngx_close_socket(ls[i].fd) == -1) { | 664 if (ngx_close_socket(ls[i].fd) == -1) { |
665 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, | 665 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, |
666 ngx_close_socket_n " listening socket on %V failed", | 666 ngx_close_socket_n " listening socket on %V failed", |
667 &ls[i].addr_text); | 667 &ls[i].addr_text); |
668 } | 668 } |
669 | |
670 #if (NGX_HAVE_UNIX_DOMAIN) | |
671 | |
672 if (ls[i].sockaddr->sa_family == AF_UNIX) { | |
673 u_char *name; | |
674 | |
675 name = ls[i].addr_text.data + sizeof("unix:") - 1; | |
676 | |
677 ngx_log_error(NGX_LOG_WARN, cycle->log, 0, | |
678 "deleting socket %s", name); | |
679 | |
680 if (ngx_delete_file(name) == -1) { | |
681 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_socket_errno, | |
682 ngx_delete_file_n " %s failed", name); | |
683 } | |
684 } | |
685 | |
686 #endif | |
669 } | 687 } |
670 | 688 |
671 | 689 |
672 /* close the unnecessary open files */ | 690 /* close the unnecessary open files */ |
673 | 691 |
833 { | 851 { |
834 struct sockaddr_in *sin1, *sin2; | 852 struct sockaddr_in *sin1, *sin2; |
835 #if (NGX_HAVE_INET6) | 853 #if (NGX_HAVE_INET6) |
836 struct sockaddr_in6 *sin61, *sin62; | 854 struct sockaddr_in6 *sin61, *sin62; |
837 #endif | 855 #endif |
856 #if (NGX_HAVE_UNIX_DOMAIN) | |
857 struct sockaddr_un *saun1, *saun2; | |
858 #endif | |
838 | 859 |
839 if (sa1->sa_family != sa2->sa_family) { | 860 if (sa1->sa_family != sa2->sa_family) { |
840 return NGX_DECLINED; | 861 return NGX_DECLINED; |
841 } | 862 } |
842 | 863 |
854 if (ngx_memcmp(&sin61->sin6_addr, &sin62->sin6_addr, 16) != 0) { | 875 if (ngx_memcmp(&sin61->sin6_addr, &sin62->sin6_addr, 16) != 0) { |
855 return NGX_DECLINED; | 876 return NGX_DECLINED; |
856 } | 877 } |
857 | 878 |
858 break; | 879 break; |
880 #endif | |
881 | |
882 #if (NGX_HAVE_UNIX_DOMAIN) | |
883 case AF_UNIX: | |
884 saun1 = (struct sockaddr_un *) sa1; | |
885 saun2 = (struct sockaddr_un *) sa2; | |
886 | |
887 if (ngx_memcmp(&saun1->sun_path, &saun2->sun_path, | |
888 sizeof(saun1->sun_path)) | |
889 != 0) | |
890 { | |
891 return NGX_DECLINED; | |
892 } | |
893 | |
894 break; | |
859 #endif | 895 #endif |
860 | 896 |
861 default: /* AF_INET */ | 897 default: /* AF_INET */ |
862 | 898 |
863 sin1 = (struct sockaddr_in *) sa1; | 899 sin1 = (struct sockaddr_in *) sa1; |