mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
*) delete no longer used unix domain sockets
*) fix unix domain socket comparison
This commit is contained in:
parent
bf8f69cf74
commit
1f07392c42
@ -666,6 +666,24 @@ old_shm_zone_done:
|
||||
ngx_close_socket_n " listening socket on %V failed",
|
||||
&ls[i].addr_text);
|
||||
}
|
||||
|
||||
#if (NGX_HAVE_UNIX_DOMAIN)
|
||||
|
||||
if (ls[i].sockaddr->sa_family == AF_UNIX) {
|
||||
u_char *name;
|
||||
|
||||
name = ls[i].addr_text.data + sizeof("unix:") - 1;
|
||||
|
||||
ngx_log_error(NGX_LOG_WARN, cycle->log, 0,
|
||||
"deleting socket %s", name);
|
||||
|
||||
if (ngx_delete_file(name) == -1) {
|
||||
ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_socket_errno,
|
||||
ngx_delete_file_n " %s failed", name);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -835,6 +853,9 @@ ngx_cmp_sockaddr(struct sockaddr *sa1, struct sockaddr *sa2)
|
||||
#if (NGX_HAVE_INET6)
|
||||
struct sockaddr_in6 *sin61, *sin62;
|
||||
#endif
|
||||
#if (NGX_HAVE_UNIX_DOMAIN)
|
||||
struct sockaddr_un *saun1, *saun2;
|
||||
#endif
|
||||
|
||||
if (sa1->sa_family != sa2->sa_family) {
|
||||
return NGX_DECLINED;
|
||||
@ -858,6 +879,21 @@ ngx_cmp_sockaddr(struct sockaddr *sa1, struct sockaddr *sa2)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if (NGX_HAVE_UNIX_DOMAIN)
|
||||
case AF_UNIX:
|
||||
saun1 = (struct sockaddr_un *) sa1;
|
||||
saun2 = (struct sockaddr_un *) sa2;
|
||||
|
||||
if (ngx_memcmp(&saun1->sun_path, &saun2->sun_path,
|
||||
sizeof(saun1->sun_path))
|
||||
!= 0)
|
||||
{
|
||||
return NGX_DECLINED;
|
||||
}
|
||||
|
||||
break;
|
||||
#endif
|
||||
|
||||
default: /* AF_INET */
|
||||
|
||||
sin1 = (struct sockaddr_in *) sa1;
|
||||
|
Loading…
Reference in New Issue
Block a user