Mercurial > hg > nginx-quic
annotate src/event/ngx_event_connect.c @ 8773:fbbb5ce52995
PCRE2 and PCRE binary compatibility.
With this change, dynamic modules using nginx regex interface can be used
regardless of the variant of the PCRE library nginx was compiled with.
If a module is compiled with different PCRE library variant, in case of
ngx_regex_exec() errors it will report wrong function name in error
messages. This is believed to be tolerable, given that fixing this will
require interface changes.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sat, 25 Dec 2021 01:07:16 +0300 |
parents | fdc3d40979b0 |
children | 32b0ba4855a6 |
rev | line source |
---|---|
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
1 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
2 /* |
444
42d11f017717
nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyright
Igor Sysoev <igor@sysoev.ru>
parents:
441
diff
changeset
|
3 * Copyright (C) Igor Sysoev |
4412 | 4 * Copyright (C) Nginx, Inc. |
441
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
5 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
6 |
86
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
7 |
136
da00cde00e8a
nginx-0.0.1-2003-10-02-09:39:37 import
Igor Sysoev <igor@sysoev.ru>
parents:
131
diff
changeset
|
8 #include <ngx_config.h> |
da00cde00e8a
nginx-0.0.1-2003-10-02-09:39:37 import
Igor Sysoev <igor@sysoev.ru>
parents:
131
diff
changeset
|
9 #include <ngx_core.h> |
da00cde00e8a
nginx-0.0.1-2003-10-02-09:39:37 import
Igor Sysoev <igor@sysoev.ru>
parents:
131
diff
changeset
|
10 #include <ngx_event.h> |
86
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 #include <ngx_event_connect.h> |
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
12 |
131
049e78b1f852
nginx-0.0.1-2003-08-14-10:00:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
124
diff
changeset
|
13 |
6530
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
14 #if (NGX_HAVE_TRANSPARENT_PROXY) |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
15 static ngx_int_t ngx_event_connect_set_transparent(ngx_peer_connection_t *pc, |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
16 ngx_socket_t s); |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
17 #endif |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
18 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
19 |
487 | 20 ngx_int_t |
21 ngx_event_connect_peer(ngx_peer_connection_t *pc) | |
86
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
22 { |
7371
8b68d50090e4
Upstream: proxy_socket_keepalive and friends.
Vladimir Homutov <vl@nginx.com>
parents:
7290
diff
changeset
|
23 int rc, type, value; |
6596
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
24 #if (NGX_HAVE_IP_BIND_ADDRESS_NO_PORT || NGX_LINUX) |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
25 in_port_t port; |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
26 #endif |
1470 | 27 ngx_int_t event; |
543 | 28 ngx_err_t err; |
884 | 29 ngx_uint_t level; |
543 | 30 ngx_socket_t s; |
31 ngx_event_t *rev, *wev; | |
32 ngx_connection_t *c; | |
122
cd91e4a1ad0d
nginx-0.0.1-2003-07-23-17:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
121
diff
changeset
|
33 |
884 | 34 rc = pc->get(pc, pc->data); |
35 if (rc != NGX_OK) { | |
36 return rc; | |
121
b3655b21375a
nginx-0.0.1-2003-07-22-23:53:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
120
diff
changeset
|
37 } |
b3655b21375a
nginx-0.0.1-2003-07-22-23:53:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
120
diff
changeset
|
38 |
6436 | 39 type = (pc->type ? pc->type : SOCK_STREAM); |
86
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
40 |
6436 | 41 s = ngx_socket(pc->sockaddr->sa_family, type, 0); |
42 | |
43 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, pc->log, 0, "%s socket %d", | |
44 (type == SOCK_STREAM) ? "stream" : "dgram", s); | |
509 | 45 |
5360
3d2d3e1cf427
Win32: MinGW GCC compatibility.
Maxim Dounin <mdounin@mdounin.ru>
parents:
5141
diff
changeset
|
46 if (s == (ngx_socket_t) -1) { |
121
b3655b21375a
nginx-0.0.1-2003-07-22-23:53:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
120
diff
changeset
|
47 ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno, |
86
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
48 ngx_socket_n " failed"); |
119
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
86
diff
changeset
|
49 return NGX_ERROR; |
86
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
50 } |
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
51 |
323
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
309
diff
changeset
|
52 |
543 | 53 c = ngx_get_connection(s, pc->log); |
323
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
309
diff
changeset
|
54 |
543 | 55 if (c == NULL) { |
323
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
309
diff
changeset
|
56 if (ngx_close_socket(s) == -1) { |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
309
diff
changeset
|
57 ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno, |
7290
91ea68dd1501
Added missing space after ngx_close_socket_n.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7217
diff
changeset
|
58 ngx_close_socket_n " failed"); |
323
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
309
diff
changeset
|
59 } |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
309
diff
changeset
|
60 |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
309
diff
changeset
|
61 return NGX_ERROR; |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
309
diff
changeset
|
62 } |
ba876b26b76d
nginx-0.0.3-2004-04-21-22:54:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
309
diff
changeset
|
63 |
6436 | 64 c->type = type; |
65 | |
121
b3655b21375a
nginx-0.0.1-2003-07-22-23:53:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
120
diff
changeset
|
66 if (pc->rcvbuf) { |
86
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
67 if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, |
563 | 68 (const void *) &pc->rcvbuf, sizeof(int)) == -1) |
69 { | |
121
b3655b21375a
nginx-0.0.1-2003-07-22-23:53:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
120
diff
changeset
|
70 ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno, |
86
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
71 "setsockopt(SO_RCVBUF) failed"); |
3271
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
72 goto failed; |
86
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
73 } |
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
74 } |
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
75 |
7371
8b68d50090e4
Upstream: proxy_socket_keepalive and friends.
Vladimir Homutov <vl@nginx.com>
parents:
7290
diff
changeset
|
76 if (pc->so_keepalive) { |
8b68d50090e4
Upstream: proxy_socket_keepalive and friends.
Vladimir Homutov <vl@nginx.com>
parents:
7290
diff
changeset
|
77 value = 1; |
8b68d50090e4
Upstream: proxy_socket_keepalive and friends.
Vladimir Homutov <vl@nginx.com>
parents:
7290
diff
changeset
|
78 |
8b68d50090e4
Upstream: proxy_socket_keepalive and friends.
Vladimir Homutov <vl@nginx.com>
parents:
7290
diff
changeset
|
79 if (setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, |
8b68d50090e4
Upstream: proxy_socket_keepalive and friends.
Vladimir Homutov <vl@nginx.com>
parents:
7290
diff
changeset
|
80 (const void *) &value, sizeof(int)) |
8b68d50090e4
Upstream: proxy_socket_keepalive and friends.
Vladimir Homutov <vl@nginx.com>
parents:
7290
diff
changeset
|
81 == -1) |
8b68d50090e4
Upstream: proxy_socket_keepalive and friends.
Vladimir Homutov <vl@nginx.com>
parents:
7290
diff
changeset
|
82 { |
8b68d50090e4
Upstream: proxy_socket_keepalive and friends.
Vladimir Homutov <vl@nginx.com>
parents:
7290
diff
changeset
|
83 ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno, |
8b68d50090e4
Upstream: proxy_socket_keepalive and friends.
Vladimir Homutov <vl@nginx.com>
parents:
7290
diff
changeset
|
84 "setsockopt(SO_KEEPALIVE) failed, ignored"); |
8b68d50090e4
Upstream: proxy_socket_keepalive and friends.
Vladimir Homutov <vl@nginx.com>
parents:
7290
diff
changeset
|
85 } |
8b68d50090e4
Upstream: proxy_socket_keepalive and friends.
Vladimir Homutov <vl@nginx.com>
parents:
7290
diff
changeset
|
86 } |
8b68d50090e4
Upstream: proxy_socket_keepalive and friends.
Vladimir Homutov <vl@nginx.com>
parents:
7290
diff
changeset
|
87 |
86
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
88 if (ngx_nonblocking(s) == -1) { |
121
b3655b21375a
nginx-0.0.1-2003-07-22-23:53:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
120
diff
changeset
|
89 ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno, |
86
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
90 ngx_nonblocking_n " failed"); |
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
91 |
3271
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
92 goto failed; |
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
93 } |
543 | 94 |
3271
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
95 if (pc->local) { |
6530
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
96 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
97 #if (NGX_HAVE_TRANSPARENT_PROXY) |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
98 if (pc->transparent) { |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
99 if (ngx_event_connect_set_transparent(pc, s) != NGX_OK) { |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
100 goto failed; |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
101 } |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
102 } |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
103 #endif |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
104 |
6596
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
105 #if (NGX_HAVE_IP_BIND_ADDRESS_NO_PORT || NGX_LINUX) |
6658
7fd6b93face8
Events: fixed setting of IP_BIND_ADDRESS_NO_PORT/SO_REUSEADDR.
Ruslan Ermilov <ru@nginx.com>
parents:
6596
diff
changeset
|
106 port = ngx_inet_get_port(pc->local->sockaddr); |
6596
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
107 #endif |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
108 |
6592
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
109 #if (NGX_HAVE_IP_BIND_ADDRESS_NO_PORT) |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
110 |
6596
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
111 if (pc->sockaddr->sa_family != AF_UNIX && port == 0) { |
6592
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
112 static int bind_address_no_port = 1; |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
113 |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
114 if (bind_address_no_port) { |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
115 if (setsockopt(s, IPPROTO_IP, IP_BIND_ADDRESS_NO_PORT, |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
116 (const void *) &bind_address_no_port, |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
117 sizeof(int)) == -1) |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
118 { |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
119 err = ngx_socket_errno; |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
120 |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
121 if (err != NGX_EOPNOTSUPP && err != NGX_ENOPROTOOPT) { |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
122 ngx_log_error(NGX_LOG_ALERT, pc->log, err, |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
123 "setsockopt(IP_BIND_ADDRESS_NO_PORT) " |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
124 "failed, ignored"); |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
125 |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
126 } else { |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
127 bind_address_no_port = 0; |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
128 } |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
129 } |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
130 } |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
131 } |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
132 |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
133 #endif |
2c7b488a61fb
Set IP_BIND_ADDRESS_NO_PORT socket option for upstream sockets.
Andrei Belov <defan@nginx.com>
parents:
6530
diff
changeset
|
134 |
6596
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
135 #if (NGX_LINUX) |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
136 |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
137 if (pc->type == SOCK_DGRAM && port != 0) { |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
138 int reuse_addr = 1; |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
139 |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
140 if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
141 (const void *) &reuse_addr, sizeof(int)) |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
142 == -1) |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
143 { |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
144 ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno, |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
145 "setsockopt(SO_REUSEADDR) failed"); |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
146 goto failed; |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
147 } |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
148 } |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
149 |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
150 #endif |
e778fe9a4463
Stream: set SO_REUSEADDR for UDP upstream sockets.
Roman Arutyunyan <arut@nginx.com>
parents:
6592
diff
changeset
|
151 |
3271
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
152 if (bind(s, pc->local->sockaddr, pc->local->socklen) == -1) { |
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
153 ngx_log_error(NGX_LOG_CRIT, pc->log, ngx_socket_errno, |
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
154 "bind(%V) failed", &pc->local->name); |
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
155 |
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
156 goto failed; |
86
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
157 } |
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
158 } |
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
159 |
6436 | 160 if (type == SOCK_STREAM) { |
161 c->recv = ngx_recv; | |
162 c->send = ngx_send; | |
163 c->recv_chain = ngx_recv_chain; | |
164 c->send_chain = ngx_send_chain; | |
165 | |
166 c->sendfile = 1; | |
483 | 167 |
6436 | 168 if (pc->sockaddr->sa_family == AF_UNIX) { |
169 c->tcp_nopush = NGX_TCP_NOPUSH_DISABLED; | |
170 c->tcp_nodelay = NGX_TCP_NODELAY_DISABLED; | |
171 | |
172 #if (NGX_SOLARIS) | |
173 /* Solaris's sendfilev() supports AF_NCA, AF_INET, and AF_INET6 */ | |
174 c->sendfile = 0; | |
175 #endif | |
176 } | |
177 | |
178 } else { /* type == SOCK_DGRAM */ | |
179 c->recv = ngx_udp_recv; | |
180 c->send = ngx_send; | |
6692 | 181 c->send_chain = ngx_udp_send_chain; |
6436 | 182 } |
1397
6c25a49e548a
upstream sendfile bit was overridden by r->connection->sendfile
Igor Sysoev <igor@sysoev.ru>
parents:
884
diff
changeset
|
183 |
543 | 184 c->log_error = pc->log_error; |
119
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
86
diff
changeset
|
185 |
561 | 186 rev = c->read; |
187 wev = c->write; | |
86
3973260705cc
nginx-0.0.1-2003-05-12-19:52:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
188 |
191
71ce40b3c37b
nginx-0.0.1-2003-11-19-19:26:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
189
diff
changeset
|
189 rev->log = pc->log; |
71ce40b3c37b
nginx-0.0.1-2003-11-19-19:26:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
189
diff
changeset
|
190 wev->log = pc->log; |
71ce40b3c37b
nginx-0.0.1-2003-11-19-19:26:41 import
Igor Sysoev <igor@sysoev.ru>
parents:
189
diff
changeset
|
191 |
121
b3655b21375a
nginx-0.0.1-2003-07-22-23:53:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
120
diff
changeset
|
192 pc->connection = c; |
119
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
86
diff
changeset
|
193 |
561 | 194 c->number = ngx_atomic_fetch_add(ngx_connection_counter, 1); |
257
70e1c7d2b83d
nginx-0.0.2-2004-02-11-20:08:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
195 |
8396
fdc3d40979b0
Introduced the "keepalive_time" directive.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7371
diff
changeset
|
196 c->start_time = ngx_current_msec; |
fdc3d40979b0
Introduced the "keepalive_time" directive.
Maxim Dounin <mdounin@mdounin.ru>
parents:
7371
diff
changeset
|
197 |
121
b3655b21375a
nginx-0.0.1-2003-07-22-23:53:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
120
diff
changeset
|
198 if (ngx_add_conn) { |
b3655b21375a
nginx-0.0.1-2003-07-22-23:53:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
120
diff
changeset
|
199 if (ngx_add_conn(c) == NGX_ERROR) { |
3271
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
200 goto failed; |
121
b3655b21375a
nginx-0.0.1-2003-07-22-23:53:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
120
diff
changeset
|
201 } |
577 | 202 } |
121
b3655b21375a
nginx-0.0.1-2003-07-22-23:53:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
120
diff
changeset
|
203 |
543 | 204 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, pc->log, 0, |
5600
957d734362ed
Fixed format specifier in logging of "c->number".
Sergey Kandaurov <pluknet@nginx.com>
parents:
5360
diff
changeset
|
205 "connect to %V, fd:%d #%uA", pc->name, s, c->number); |
137
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
206 |
884 | 207 rc = connect(s, pc->sockaddr, pc->socklen); |
122
cd91e4a1ad0d
nginx-0.0.1-2003-07-23-17:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
121
diff
changeset
|
208 |
cd91e4a1ad0d
nginx-0.0.1-2003-07-23-17:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
121
diff
changeset
|
209 if (rc == -1) { |
cd91e4a1ad0d
nginx-0.0.1-2003-07-23-17:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
121
diff
changeset
|
210 err = ngx_socket_errno; |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
169
diff
changeset
|
211 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
169
diff
changeset
|
212 |
2117
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
213 if (err != NGX_EINPROGRESS |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
214 #if (NGX_WIN32) |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
215 /* Winsock returns WSAEWOULDBLOCK (NGX_EAGAIN) */ |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
216 && err != NGX_EAGAIN |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
217 #endif |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
218 ) |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
219 { |
1869
192443881e51
add NGX_ENETDOWN, NGX_ENETUNREACH, and NGX_EHOSTDOWN
Igor Sysoev <igor@sysoev.ru>
parents:
1470
diff
changeset
|
220 if (err == NGX_ECONNREFUSED |
2117
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
221 #if (NGX_LINUX) |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
222 /* |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
223 * Linux returns EAGAIN instead of ECONNREFUSED |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
224 * for unix sockets if listen queue is full |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
225 */ |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
226 || err == NGX_EAGAIN |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
227 #endif |
2540 | 228 || err == NGX_ECONNRESET |
1869
192443881e51
add NGX_ENETDOWN, NGX_ENETUNREACH, and NGX_EHOSTDOWN
Igor Sysoev <igor@sysoev.ru>
parents:
1470
diff
changeset
|
229 || err == NGX_ENETDOWN |
192443881e51
add NGX_ENETDOWN, NGX_ENETUNREACH, and NGX_EHOSTDOWN
Igor Sysoev <igor@sysoev.ru>
parents:
1470
diff
changeset
|
230 || err == NGX_ENETUNREACH |
192443881e51
add NGX_ENETDOWN, NGX_ENETUNREACH, and NGX_EHOSTDOWN
Igor Sysoev <igor@sysoev.ru>
parents:
1470
diff
changeset
|
231 || err == NGX_EHOSTDOWN |
192443881e51
add NGX_ENETDOWN, NGX_ENETUNREACH, and NGX_EHOSTDOWN
Igor Sysoev <igor@sysoev.ru>
parents:
1470
diff
changeset
|
232 || err == NGX_EHOSTUNREACH) |
192443881e51
add NGX_ENETDOWN, NGX_ENETUNREACH, and NGX_EHOSTDOWN
Igor Sysoev <igor@sysoev.ru>
parents:
1470
diff
changeset
|
233 { |
541 | 234 level = NGX_LOG_ERR; |
1869
192443881e51
add NGX_ENETDOWN, NGX_ENETUNREACH, and NGX_EHOSTDOWN
Igor Sysoev <igor@sysoev.ru>
parents:
1470
diff
changeset
|
235 |
541 | 236 } else { |
237 level = NGX_LOG_CRIT; | |
238 } | |
487 | 239 |
541 | 240 ngx_log_error(level, c->log, err, "connect() to %V failed", |
884 | 241 pc->name); |
139
54307053f185
nginx-0.0.1-2003-10-07-19:30:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
137
diff
changeset
|
242 |
4421
fbae1a82de8b
Fixed error handling in ngx_event_connect_peer().
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
243 ngx_close_connection(c); |
fbae1a82de8b
Fixed error handling in ngx_event_connect_peer().
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
244 pc->connection = NULL; |
fbae1a82de8b
Fixed error handling in ngx_event_connect_peer().
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
245 |
543 | 246 return NGX_DECLINED; |
122
cd91e4a1ad0d
nginx-0.0.1-2003-07-23-17:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
121
diff
changeset
|
247 } |
cd91e4a1ad0d
nginx-0.0.1-2003-07-23-17:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
121
diff
changeset
|
248 } |
cd91e4a1ad0d
nginx-0.0.1-2003-07-23-17:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
121
diff
changeset
|
249 |
344
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
250 if (ngx_add_conn) { |
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
251 if (rc == -1) { |
487 | 252 |
344
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
253 /* NGX_EINPROGRESS */ |
487 | 254 |
344
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
255 return NGX_AGAIN; |
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
256 } |
577 | 257 |
344
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
258 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, pc->log, 0, "connected"); |
483 | 259 |
260 wev->ready = 1; | |
261 | |
344
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
262 return NGX_OK; |
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
263 } |
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
264 |
6125
4dc8e7b62216
Removed the obsolete aio module.
Ruslan Ermilov <ru@nginx.com>
parents:
5820
diff
changeset
|
265 if (ngx_event_flags & NGX_USE_IOCP_EVENT) { |
167
8aef3c72e5da
nginx-0.0.1-2003-10-30-19:51:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
166
diff
changeset
|
266 |
455 | 267 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, pc->log, ngx_socket_errno, |
268 "connect(): %d", rc); | |
269 | |
167
8aef3c72e5da
nginx-0.0.1-2003-10-30-19:51:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
166
diff
changeset
|
270 if (ngx_blocking(s) == -1) { |
8aef3c72e5da
nginx-0.0.1-2003-10-30-19:51:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
166
diff
changeset
|
271 ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno, |
8aef3c72e5da
nginx-0.0.1-2003-10-30-19:51:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
166
diff
changeset
|
272 ngx_blocking_n " failed"); |
3271
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
273 goto failed; |
167
8aef3c72e5da
nginx-0.0.1-2003-10-30-19:51:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
166
diff
changeset
|
274 } |
8aef3c72e5da
nginx-0.0.1-2003-10-30-19:51:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
166
diff
changeset
|
275 |
8aef3c72e5da
nginx-0.0.1-2003-10-30-19:51:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
166
diff
changeset
|
276 /* |
487 | 277 * FreeBSD's aio allows to post an operation on non-connected socket. |
186
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
169
diff
changeset
|
278 * NT does not support it. |
577 | 279 * |
169
edf29bb717da
nginx-0.0.1-2003-10-31-19:05:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
168
diff
changeset
|
280 * TODO: check in Win32, etc. As workaround we can use NGX_ONESHOT_EVENT |
167
8aef3c72e5da
nginx-0.0.1-2003-10-30-19:51:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
166
diff
changeset
|
281 */ |
577 | 282 |
166
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
164
diff
changeset
|
283 rev->ready = 1; |
164
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
162
diff
changeset
|
284 wev->ready = 1; |
166
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
164
diff
changeset
|
285 |
164
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
162
diff
changeset
|
286 return NGX_OK; |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
162
diff
changeset
|
287 } |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
162
diff
changeset
|
288 |
487 | 289 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) { |
290 | |
291 /* kqueue */ | |
292 | |
137
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
293 event = NGX_CLEAR_EVENT; |
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
294 |
487 | 295 } else { |
296 | |
297 /* select, poll, /dev/poll */ | |
298 | |
137
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
299 event = NGX_LEVEL_EVENT; |
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
300 } |
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
301 |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
302 if (ngx_add_event(rev, NGX_READ_EVENT, event) != NGX_OK) { |
3271
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
303 goto failed; |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
304 } |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
305 |
137
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
306 if (rc == -1) { |
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
307 |
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
308 /* NGX_EINPROGRESS */ |
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
309 |
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
310 if (ngx_add_event(wev, NGX_WRITE_EVENT, event) != NGX_OK) { |
3271
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
311 goto failed; |
137
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
312 } |
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
313 |
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
314 return NGX_AGAIN; |
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
315 } |
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
316 |
257
70e1c7d2b83d
nginx-0.0.2-2004-02-11-20:08:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
317 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, pc->log, 0, "connected"); |
189
c966c09be66b
nginx-0.0.1-2003-11-18-19:49:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
186
diff
changeset
|
318 |
148
5afee0074707
nginx-0.0.1-2003-10-17-00:19:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
144
diff
changeset
|
319 wev->ready = 1; |
5afee0074707
nginx-0.0.1-2003-10-17-00:19:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
144
diff
changeset
|
320 |
136
da00cde00e8a
nginx-0.0.1-2003-10-02-09:39:37 import
Igor Sysoev <igor@sysoev.ru>
parents:
131
diff
changeset
|
321 return NGX_OK; |
3271
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
322 |
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
323 failed: |
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
324 |
4421
fbae1a82de8b
Fixed error handling in ngx_event_connect_peer().
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
325 ngx_close_connection(c); |
fbae1a82de8b
Fixed error handling in ngx_event_connect_peer().
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
326 pc->connection = NULL; |
3271
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
327 |
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
328 return NGX_ERROR; |
119
cd54bcbaf3b5
nginx-0.0.1-2003-07-21-01:15:59 import
Igor Sysoev <igor@sysoev.ru>
parents:
86
diff
changeset
|
329 } |
131
049e78b1f852
nginx-0.0.1-2003-08-14-10:00:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
124
diff
changeset
|
330 |
049e78b1f852
nginx-0.0.1-2003-08-14-10:00:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
124
diff
changeset
|
331 |
6530
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
332 #if (NGX_HAVE_TRANSPARENT_PROXY) |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
333 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
334 static ngx_int_t |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
335 ngx_event_connect_set_transparent(ngx_peer_connection_t *pc, ngx_socket_t s) |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
336 { |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
337 int value; |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
338 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
339 value = 1; |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
340 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
341 #if defined(SO_BINDANY) |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
342 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
343 if (setsockopt(s, SOL_SOCKET, SO_BINDANY, |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
344 (const void *) &value, sizeof(int)) == -1) |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
345 { |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
346 ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno, |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
347 "setsockopt(SO_BINDANY) failed"); |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
348 return NGX_ERROR; |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
349 } |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
350 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
351 #else |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
352 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
353 switch (pc->local->sockaddr->sa_family) { |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
354 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
355 case AF_INET: |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
356 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
357 #if defined(IP_TRANSPARENT) |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
358 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
359 if (setsockopt(s, IPPROTO_IP, IP_TRANSPARENT, |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
360 (const void *) &value, sizeof(int)) == -1) |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
361 { |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
362 ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno, |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
363 "setsockopt(IP_TRANSPARENT) failed"); |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
364 return NGX_ERROR; |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
365 } |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
366 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
367 #elif defined(IP_BINDANY) |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
368 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
369 if (setsockopt(s, IPPROTO_IP, IP_BINDANY, |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
370 (const void *) &value, sizeof(int)) == -1) |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
371 { |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
372 ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno, |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
373 "setsockopt(IP_BINDANY) failed"); |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
374 return NGX_ERROR; |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
375 } |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
376 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
377 #endif |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
378 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
379 break; |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
380 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
381 #if (NGX_HAVE_INET6) |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
382 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
383 case AF_INET6: |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
384 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
385 #if defined(IPV6_TRANSPARENT) |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
386 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
387 if (setsockopt(s, IPPROTO_IPV6, IPV6_TRANSPARENT, |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
388 (const void *) &value, sizeof(int)) == -1) |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
389 { |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
390 ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno, |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
391 "setsockopt(IPV6_TRANSPARENT) failed"); |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
392 return NGX_ERROR; |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
393 } |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
394 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
395 #elif defined(IPV6_BINDANY) |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
396 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
397 if (setsockopt(s, IPPROTO_IPV6, IPV6_BINDANY, |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
398 (const void *) &value, sizeof(int)) == -1) |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
399 { |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
400 ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno, |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
401 "setsockopt(IPV6_BINDANY) failed"); |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
402 return NGX_ERROR; |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
403 } |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
404 |
7217
8b70d4caa505
Generate error for unsupported IPv6 transparent proxy.
Roman Arutyunyan <arut@nginx.com>
parents:
6692
diff
changeset
|
405 #else |
8b70d4caa505
Generate error for unsupported IPv6 transparent proxy.
Roman Arutyunyan <arut@nginx.com>
parents:
6692
diff
changeset
|
406 |
8b70d4caa505
Generate error for unsupported IPv6 transparent proxy.
Roman Arutyunyan <arut@nginx.com>
parents:
6692
diff
changeset
|
407 ngx_log_error(NGX_LOG_ALERT, pc->log, 0, |
8b70d4caa505
Generate error for unsupported IPv6 transparent proxy.
Roman Arutyunyan <arut@nginx.com>
parents:
6692
diff
changeset
|
408 "could not enable transparent proxying for IPv6 " |
8b70d4caa505
Generate error for unsupported IPv6 transparent proxy.
Roman Arutyunyan <arut@nginx.com>
parents:
6692
diff
changeset
|
409 "on this platform"); |
8b70d4caa505
Generate error for unsupported IPv6 transparent proxy.
Roman Arutyunyan <arut@nginx.com>
parents:
6692
diff
changeset
|
410 |
8b70d4caa505
Generate error for unsupported IPv6 transparent proxy.
Roman Arutyunyan <arut@nginx.com>
parents:
6692
diff
changeset
|
411 return NGX_ERROR; |
8b70d4caa505
Generate error for unsupported IPv6 transparent proxy.
Roman Arutyunyan <arut@nginx.com>
parents:
6692
diff
changeset
|
412 |
6530
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
413 #endif |
7217
8b70d4caa505
Generate error for unsupported IPv6 transparent proxy.
Roman Arutyunyan <arut@nginx.com>
parents:
6692
diff
changeset
|
414 |
6530
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
415 break; |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
416 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
417 #endif /* NGX_HAVE_INET6 */ |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
418 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
419 } |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
420 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
421 #endif /* SO_BINDANY */ |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
422 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
423 return NGX_OK; |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
424 } |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
425 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
426 #endif |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
427 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
428 |
884 | 429 ngx_int_t |
430 ngx_event_get_peer(ngx_peer_connection_t *pc, void *data) | |
131
049e78b1f852
nginx-0.0.1-2003-08-14-10:00:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
124
diff
changeset
|
431 { |
884 | 432 return NGX_OK; |
131
049e78b1f852
nginx-0.0.1-2003-08-14-10:00:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
124
diff
changeset
|
433 } |