diff options
author | Igor Sysoev <igor@sysoev.ru> | 2017-08-26 13:37:24 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2017-08-26 13:37:24 +0300 |
commit | 1a6036d0227b167c8ac85d3d65a6f60223276367 (patch) | |
tree | 60ba2f0320d7536d2a6b5818d1501da0ad11c144 | |
parent | 5118a0a89d3e10840f50a440b6c248a38a7071b1 (diff) | |
download | unit-1a6036d0227b167c8ac85d3d65a6f60223276367.tar.gz unit-1a6036d0227b167c8ac85d3d65a6f60223276367.tar.bz2 |
Removed unused function.
-rw-r--r-- | src/nxt_listen_socket.c | 68 | ||||
-rw-r--r-- | src/nxt_listen_socket.h | 2 |
2 files changed, 0 insertions, 70 deletions
diff --git a/src/nxt_listen_socket.c b/src/nxt_listen_socket.c index a875832c..041c5384 100644 --- a/src/nxt_listen_socket.c +++ b/src/nxt_listen_socket.c @@ -11,74 +11,6 @@ static u_char *nxt_listen_socket_log_handler(void *ctx, u_char *pos, u_char *last); -nxt_socket_t -nxt_listen_socket_create0(nxt_task_t *task, nxt_sockaddr_t *sa, - nxt_uint_t flags) -{ - nxt_int_t ret; - nxt_socket_t s; - - s = nxt_socket_create(task, sa->u.sockaddr.sa_family, sa->type, 0, flags); - if (nxt_slow_path(s == -1)) { - return s; - } - - ret = nxt_socket_setsockopt(task, s, SOL_SOCKET, SO_REUSEADDR, 1); - if (nxt_slow_path(ret != NXT_OK)) { - goto fail; - } - -#if (NXT_INET6) - - if (sa->u.sockaddr.sa_family == AF_INET6) { - ret = nxt_socket_setsockopt(task, s, IPPROTO_IPV6, IPV6_V6ONLY, 1); - if (nxt_slow_path(ret != NXT_OK)) { - goto fail; - } - } - -#endif - -#ifdef TCP_DEFER_ACCEPT - - /* Defer Linux accept() up to for 1 second. */ - (void) nxt_socket_setsockopt(task, s, IPPROTO_TCP, TCP_DEFER_ACCEPT, 1); - -#endif - - ret = nxt_socket_bind(task, s, sa, 0); - if (nxt_slow_path(ret != NXT_OK)) { - goto fail; - } - -#if (NXT_HAVE_UNIX_DOMAIN) - - if (sa->u.sockaddr.sa_family == AF_UNIX) { - nxt_file_name_t *name; - nxt_file_access_t access; - - name = (nxt_file_name_t *) sa->u.sockaddr_un.sun_path; - - access = (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); - - ret = nxt_file_set_access(name, access); - if (nxt_slow_path(ret != NXT_OK)) { - goto fail; - } - } - -#endif - - return s; - -fail: - - nxt_socket_close(task, s); - - return -1; -} - - nxt_int_t nxt_listen_socket(nxt_task_t *task, nxt_socket_t s, int backlog) { diff --git a/src/nxt_listen_socket.h b/src/nxt_listen_socket.h index c58850ba..c872f27d 100644 --- a/src/nxt_listen_socket.h +++ b/src/nxt_listen_socket.h @@ -49,8 +49,6 @@ typedef struct { #endif -NXT_EXPORT nxt_socket_t nxt_listen_socket_create0(nxt_task_t *task, - nxt_sockaddr_t *sa, nxt_uint_t flags); NXT_EXPORT nxt_int_t nxt_listen_socket(nxt_task_t *task, nxt_socket_t s, int backlog); |