Home
last modified time | relevance | path

Searched refs:sa (Results 1 – 21 of 21) sorted by path

/unit/auto/
H A Dsockets40 struct sockaddr sa;
42 sa.sa_len = 0;
43 printf(\"%d\", sa.sa_len);
/unit/src/java/nginx/unit/websocket/
H A DWsWebSocketContainer.java227 SocketAddress sa = null; in connectToServerRecursive() local
235 sa = proxy.address(); in connectToServerRecursive()
236 if (sa instanceof InetSocketAddress) { in connectToServerRecursive()
237 InetSocketAddress inet = (InetSocketAddress) sa; in connectToServerRecursive()
239 sa = new InetSocketAddress(inet.getHostName(), inet.getPort()); in connectToServerRecursive()
259 if (sa == null) { in connectToServerRecursive()
260 sa = new InetSocketAddress(host, port); in connectToServerRecursive()
303 Future<Void> fConnect = socketChannel.connect(sa); in connectToServerRecursive()
/unit/src/
H A Dnxt_conf_validation.c1483 nxt_sockaddr_t *sa; in nxt_conf_vldt_listener() local
1485 sa = nxt_sockaddr_parse(vldt->pool, name); in nxt_conf_vldt_listener()
1486 if (nxt_slow_path(sa == NULL)) { in nxt_conf_vldt_listener()
1753 nxt_sockaddr_t *sa; in nxt_conf_vldt_proxy() local
1761 sa = nxt_sockaddr_parse(vldt->pool, &name); in nxt_conf_vldt_proxy()
1762 if (sa != NULL) { in nxt_conf_vldt_proxy()
3070 nxt_sockaddr_t *sa; in nxt_conf_vldt_server() local
3078 sa = nxt_sockaddr_parse(vldt->pool, name); in nxt_conf_vldt_server()
3080 if (sa == NULL) { in nxt_conf_vldt_server()
H A Dnxt_conn.c137 nxt_sockaddr_t *sa; in nxt_conn_local_addr() local
161 sa = nxt_mp_get(c->mem_pool, size); in nxt_conn_local_addr()
162 if (nxt_slow_path(sa == NULL)) { in nxt_conn_local_addr()
166 sa->socklen = socklen; in nxt_conn_local_addr()
167 sa->length = length; in nxt_conn_local_addr()
169 ret = getsockname(c->socket.fd, &sa->u.sockaddr, &socklen); in nxt_conn_local_addr()
175 c->local = sa; in nxt_conn_local_addr()
177 nxt_sockaddr_text(sa); in nxt_conn_local_addr()
184 return sa; in nxt_conn_local_addr()
H A Dnxt_conn_accept.c141 struct sockaddr *sa; in nxt_conn_io_accept() local
150 sa = &c->remote->u.sockaddr; in nxt_conn_io_accept()
161 s = accept(lev->socket.fd, sa, &socklen); in nxt_conn_io_accept()
H A Dnxt_epoll_engine.c1013 struct sockaddr *sa; in nxt_epoll_conn_io_accept4() local
1022 sa = &c->remote->u.sockaddr; in nxt_epoll_conn_io_accept4()
1028 s = accept4(lev->socket.fd, sa, &socklen, SOCK_NONBLOCK); in nxt_epoll_conn_io_accept4()
H A Dnxt_http_proxy.c57 nxt_sockaddr_t *sa; in nxt_http_proxy_init() local
61 sa = NULL; in nxt_http_proxy_init()
68 sa = nxt_sockaddr_parse(mp, &name); in nxt_http_proxy_init()
69 if (nxt_slow_path(sa == NULL)) { in nxt_http_proxy_init()
73 sa->type = SOCK_STREAM; in nxt_http_proxy_init()
76 if (sa != NULL) { in nxt_http_proxy_init()
82 up->name.length = sa->length; in nxt_http_proxy_init()
83 up->name.start = nxt_sockaddr_start(sa); in nxt_http_proxy_init()
91 proxy->sockaddr = sa; in nxt_http_proxy_init()
H A Dnxt_http_request.c411 nxt_sockaddr_t *sa, *prev_sa; in nxt_http_request_forward_client_ip() local
438 if (nxt_slow_path(sa == NULL)) { in nxt_http_request_forward_client_ip()
447 r->remote = sa; in nxt_http_request_forward_client_ip()
453 r->remote = sa; in nxt_http_request_forward_client_ip()
457 prev_sa = sa; in nxt_http_request_forward_client_ip()
470 nxt_sockaddr_t *sa; in nxt_http_request_client_ip_sockaddr() local
475 sa = nxt_sockaddr_parse_optport(r->mem_pool, &addr); in nxt_http_request_client_ip_sockaddr()
476 if (nxt_slow_path(sa == NULL)) { in nxt_http_request_client_ip_sockaddr()
480 switch (sa->u.sockaddr.sa_family) { in nxt_http_request_client_ip_sockaddr()
482 if (sa->u.sockaddr_in.sin_addr.s_addr == INADDR_ANY) { in nxt_http_request_client_ip_sockaddr()
[all …]
H A Dnxt_http_route.c1704 nxt_sockaddr_t *sa) in nxt_http_route_addr_pattern_match() argument
1719 switch (sa->u.sockaddr.sa_family) { in nxt_http_route_addr_pattern_match()
1729 sin = &sa->u.sockaddr_in; in nxt_http_route_addr_pattern_match()
1775 sin6 = &sa->u.sockaddr_in6; in nxt_http_route_addr_pattern_match()
1839 nxt_http_route_addr_rule_t *addr_rule, nxt_sockaddr_t *sa) in nxt_http_route_addr_rule() argument
1857 matches = nxt_http_route_addr_pattern_match(p, sa); in nxt_http_route_addr_rule()
H A Dnxt_kqueue_engine.c566 struct sigaction sa; in nxt_kqueue_add_signal() local
570 nxt_memzero(&sa, sizeof(struct sigaction)); in nxt_kqueue_add_signal()
571 sigemptyset(&sa.sa_mask); in nxt_kqueue_add_signal()
579 sa.sa_handler = (signo == SIGCHLD) ? SIG_DFL : SIG_IGN; in nxt_kqueue_add_signal()
581 if (sigaction(signo, &sa, NULL) != 0) { in nxt_kqueue_add_signal()
934 struct sockaddr *sa; in nxt_kqueue_conn_io_accept() local
946 sa = &c->remote->u.sockaddr; in nxt_kqueue_conn_io_accept()
952 s = accept(lev->socket.fd, sa, &socklen); in nxt_kqueue_conn_io_accept()
H A Dnxt_listen_socket.c37 nxt_sockaddr_t *sa; in nxt_listen_socket_create() local
48 sa = ls->sockaddr; in nxt_listen_socket_create()
54 log.ctx = sa; in nxt_listen_socket_create()
99 orig_sa = sa; in nxt_listen_socket_create()
101 sa = nxt_sockaddr_alloc(mp, sa->socklen + 4, sa->length + 4); in nxt_listen_socket_create()
102 if (sa == NULL) { in nxt_listen_socket_create()
106 sa->type = SOCK_STREAM; in nxt_listen_socket_create()
113 nxt_sockaddr_text(sa); in nxt_listen_socket_create()
378 nxt_sockaddr_t *sa; in nxt_listen_socket_log_handler() local
380 sa = ctx; in nxt_listen_socket_log_handler()
[all …]
H A Dnxt_main_process.c1032 nxt_sockaddr_t *sa; in nxt_main_port_socket_handler() local
1051 sa = (nxt_sockaddr_t *) b->mem.pos; in nxt_main_port_socket_handler()
1061 (size_t) sa->length, nxt_sockaddr_start(sa)); in nxt_main_port_socket_handler()
1063 ret = nxt_main_listening_socket(sa, &ls); in nxt_main_port_socket_handler()
1067 (size_t) sa->length, nxt_sockaddr_start(sa), ls.socket); in nxt_main_port_socket_handler()
1103 s = socket(sa->u.sockaddr.sa_family, sa->type, 0); in nxt_main_listening_socket()
1118 (size_t) sa->length, nxt_sockaddr_start(sa), err); in nxt_main_listening_socket()
1126 (size_t) sa->length, nxt_sockaddr_start(sa), in nxt_main_listening_socket()
1138 (size_t) sa->length, nxt_sockaddr_start(sa), in nxt_main_listening_socket()
1146 if (bind(s, &sa->u.sockaddr, sa->socklen) != 0) { in nxt_main_listening_socket()
[all …]
H A Dnxt_router.c2425 nxt_sockaddr_t *sa; in nxt_router_socket_conf() local
2430 if (nxt_slow_path(sa == NULL)) { in nxt_router_socket_conf()
2435 sa->type = SOCK_STREAM; in nxt_router_socket_conf()
2438 (size_t) sa->length, nxt_sockaddr_start(sa)); in nxt_router_socket_conf()
2445 size = nxt_sockaddr_size(sa); in nxt_router_socket_conf()
2459 nxt_memcpy(ls->sockaddr, sa, size); in nxt_router_socket_conf()
2469 switch (sa->u.sockaddr.sa_family) { in nxt_router_socket_conf()
2492 nxt_memcpy(skcf->sockaddr, sa, size); in nxt_router_socket_conf()
2646 nxt_sockaddr_t *sa; in nxt_router_listen_socket_error()
2658 sa = rpc->socket_conf->listen->sockaddr; in nxt_router_listen_socket_error()
[all …]
H A Dnxt_runtime.c566 nxt_sockaddr_t *sa; in nxt_runtime_exit() local
569 sa = rt->controller_listen; in nxt_runtime_exit()
571 if (sa->u.sockaddr.sa_family == AF_UNIX) { in nxt_runtime_exit()
760 nxt_sockaddr_t *sa; in nxt_runtime_conf_init() local
895 sa = nxt_sockaddr_parse(rt->mem_pool, &control); in nxt_runtime_conf_init()
896 if (nxt_slow_path(sa == NULL)) { in nxt_runtime_conf_init()
900 sa->type = SOCK_STREAM; in nxt_runtime_conf_init()
902 rt->controller_listen = sa; in nxt_runtime_conf_init()
1129 ls->sockaddr = nxt_sockaddr_create(mp, &sa->u.sockaddr, sa->socklen, in nxt_runtime_listen_socket_add()
1130 sa->length); in nxt_runtime_listen_socket_add()
[all …]
H A Dnxt_runtime.h127 nxt_sockaddr_t *sa);
H A Dnxt_signal.c74 struct sigaction sa; in nxt_signal_action() local
76 nxt_memzero(&sa, sizeof(struct sigaction)); in nxt_signal_action()
77 sigemptyset(&sa.sa_mask); in nxt_signal_action()
78 sa.sa_handler = handler; in nxt_signal_action()
80 if (sigaction(signo, &sa, NULL) == 0) { in nxt_signal_action()
H A Dnxt_sockaddr.c48 return sa; in nxt_sockaddr_cache_alloc()
59 nxt_event_engine_mem_free(engine, sa->cache_hint, sa, 0); in nxt_sockaddr_cache_free()
86 return sa; in nxt_sockaddr_alloc()
161 return sa; in nxt_sockaddr_create()
253 sa->port_start += sa->address_length + 1; in nxt_sockaddr_text()
270 sa->port_start += sa->address_length + 3; in nxt_sockaddr_text()
308 sa->port_start += sa->address_length; in nxt_sockaddr_text()
539 return sa; in nxt_sockaddr_parse()
567 return sa; in nxt_sockaddr_parse_optport()
629 return sa; in nxt_sockaddr_unix_parse()
[all …]
H A Dnxt_sockaddr.h76 NXT_EXPORT void nxt_sockaddr_text(nxt_sockaddr_t *sa);
79 NXT_EXPORT uint32_t nxt_sockaddr_port_number(nxt_sockaddr_t *sa);
99 #define nxt_sockaddr_size(sa) \ argument
100 (offsetof(nxt_sockaddr_t, u) + sa->socklen + sa->length)
101 #define nxt_sockaddr_start(sa) nxt_pointer_to(sa, (sa)->start) argument
102 #define nxt_sockaddr_address(sa) nxt_pointer_to(sa, (sa)->address_start) argument
103 #define nxt_sockaddr_port(sa) nxt_pointer_to(sa, (sa)->port_start) argument
104 #define nxt_sockaddr_port_length(sa) \ argument
105 (((sa)->start + (sa)->length) - (sa)->port_start)
H A Dnxt_socket.c58 if (sa->u.sockaddr.sa_family == AF_UNIX) { in nxt_socket_defer_accept()
175 nxt_socket_bind(nxt_task_t *task, nxt_socket_t s, nxt_sockaddr_t *sa) in nxt_socket_bind() argument
177 nxt_debug(task, "bind(%d, %*s)", s, (size_t) sa->length, in nxt_socket_bind()
178 nxt_sockaddr_start(sa)); in nxt_socket_bind()
180 if (nxt_fast_path(bind(s, &sa->u.sockaddr, sa->socklen) == 0)) { in nxt_socket_bind()
185 s, (size_t) sa->length, nxt_sockaddr_start(sa), nxt_socket_errno); in nxt_socket_bind()
192 nxt_socket_connect(nxt_task_t *task, nxt_socket_t s, nxt_sockaddr_t *sa) in nxt_socket_connect() argument
199 s, (size_t) sa->length, nxt_sockaddr_start(sa)); in nxt_socket_connect()
201 if (connect(s, &sa->u.sockaddr, sa->socklen) == 0) { in nxt_socket_connect()
211 s, (size_t) sa->length, nxt_sockaddr_start(sa)); in nxt_socket_connect()
[all …]
H A Dnxt_socket.h97 nxt_sockaddr_t *sa);
103 nxt_sockaddr_t *sa);
105 nxt_sockaddr_t *sa);
H A Dnxt_upstream_round_robin.c51 nxt_sockaddr_t *sa; in nxt_upstream_round_robin_create() local
97 sa = nxt_sockaddr_parse(mp, &name); in nxt_upstream_round_robin_create()
98 if (nxt_slow_path(sa == NULL)) { in nxt_upstream_round_robin_create()
102 sa->type = SOCK_STREAM; in nxt_upstream_round_robin_create()
104 urr->server[i].sockaddr = sa; in nxt_upstream_round_robin_create()