Mercurial > hg > nginx-quic
annotate src/event/ngx_event_connect.c @ 8288:0b3d70fbba99 quic
QUIC: fixed logging ACK frames.
Previously, the wrong end pointer was used, which could lead to errors
"quic failed to parse ack frame gap".
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Tue, 09 Feb 2021 14:31:36 +0300 |
parents | 8b68d50090e4 |
children | fdc3d40979b0 |
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 |
121
b3655b21375a
nginx-0.0.1-2003-07-22-23:53:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
120
diff
changeset
|
196 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
|
197 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
|
198 goto failed; |
121
b3655b21375a
nginx-0.0.1-2003-07-22-23:53:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
120
diff
changeset
|
199 } |
577 | 200 } |
121
b3655b21375a
nginx-0.0.1-2003-07-22-23:53:10 import
Igor Sysoev <igor@sysoev.ru>
parents:
120
diff
changeset
|
201 |
543 | 202 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
|
203 "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
|
204 |
884 | 205 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
|
206 |
cd91e4a1ad0d
nginx-0.0.1-2003-07-23-17:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
121
diff
changeset
|
207 if (rc == -1) { |
cd91e4a1ad0d
nginx-0.0.1-2003-07-23-17:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
121
diff
changeset
|
208 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
|
209 |
c1f3a3c7c5db
nginx-0.0.1-2003-11-17-00:49:42 import
Igor Sysoev <igor@sysoev.ru>
parents:
169
diff
changeset
|
210 |
2117
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
211 if (err != NGX_EINPROGRESS |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
212 #if (NGX_WIN32) |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
213 /* Winsock returns WSAEWOULDBLOCK (NGX_EAGAIN) */ |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
214 && err != NGX_EAGAIN |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
215 #endif |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
216 ) |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
217 { |
1869
192443881e51
add NGX_ENETDOWN, NGX_ENETUNREACH, and NGX_EHOSTDOWN
Igor Sysoev <igor@sysoev.ru>
parents:
1470
diff
changeset
|
218 if (err == NGX_ECONNREFUSED |
2117
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
219 #if (NGX_LINUX) |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
220 /* |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
221 * Linux returns EAGAIN instead of ECONNREFUSED |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
222 * for unix sockets if listen queue is full |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
223 */ |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
224 || err == NGX_EAGAIN |
9d62abd76ea5
handle connect()'s EAGAIN on Linux
Igor Sysoev <igor@sysoev.ru>
parents:
1869
diff
changeset
|
225 #endif |
2540 | 226 || err == NGX_ECONNRESET |
1869
192443881e51
add NGX_ENETDOWN, NGX_ENETUNREACH, and NGX_EHOSTDOWN
Igor Sysoev <igor@sysoev.ru>
parents:
1470
diff
changeset
|
227 || err == NGX_ENETDOWN |
192443881e51
add NGX_ENETDOWN, NGX_ENETUNREACH, and NGX_EHOSTDOWN
Igor Sysoev <igor@sysoev.ru>
parents:
1470
diff
changeset
|
228 || err == NGX_ENETUNREACH |
192443881e51
add NGX_ENETDOWN, NGX_ENETUNREACH, and NGX_EHOSTDOWN
Igor Sysoev <igor@sysoev.ru>
parents:
1470
diff
changeset
|
229 || err == NGX_EHOSTDOWN |
192443881e51
add NGX_ENETDOWN, NGX_ENETUNREACH, and NGX_EHOSTDOWN
Igor Sysoev <igor@sysoev.ru>
parents:
1470
diff
changeset
|
230 || err == NGX_EHOSTUNREACH) |
192443881e51
add NGX_ENETDOWN, NGX_ENETUNREACH, and NGX_EHOSTDOWN
Igor Sysoev <igor@sysoev.ru>
parents:
1470
diff
changeset
|
231 { |
541 | 232 level = NGX_LOG_ERR; |
1869
192443881e51
add NGX_ENETDOWN, NGX_ENETUNREACH, and NGX_EHOSTDOWN
Igor Sysoev <igor@sysoev.ru>
parents:
1470
diff
changeset
|
233 |
541 | 234 } else { |
235 level = NGX_LOG_CRIT; | |
236 } | |
487 | 237 |
541 | 238 ngx_log_error(level, c->log, err, "connect() to %V failed", |
884 | 239 pc->name); |
139
54307053f185
nginx-0.0.1-2003-10-07-19:30:05 import
Igor Sysoev <igor@sysoev.ru>
parents:
137
diff
changeset
|
240 |
4421
fbae1a82de8b
Fixed error handling in ngx_event_connect_peer().
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
241 ngx_close_connection(c); |
fbae1a82de8b
Fixed error handling in ngx_event_connect_peer().
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
242 pc->connection = NULL; |
fbae1a82de8b
Fixed error handling in ngx_event_connect_peer().
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
243 |
543 | 244 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
|
245 } |
cd91e4a1ad0d
nginx-0.0.1-2003-07-23-17:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
121
diff
changeset
|
246 } |
cd91e4a1ad0d
nginx-0.0.1-2003-07-23-17:10:12 import
Igor Sysoev <igor@sysoev.ru>
parents:
121
diff
changeset
|
247 |
344
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
248 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
|
249 if (rc == -1) { |
487 | 250 |
344
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
251 /* NGX_EINPROGRESS */ |
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 return NGX_AGAIN; |
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
254 } |
577 | 255 |
344
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
256 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, pc->log, 0, "connected"); |
483 | 257 |
258 wev->ready = 1; | |
259 | |
344
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
260 return NGX_OK; |
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
261 } |
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
323
diff
changeset
|
262 |
6125
4dc8e7b62216
Removed the obsolete aio module.
Ruslan Ermilov <ru@nginx.com>
parents:
5820
diff
changeset
|
263 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
|
264 |
455 | 265 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, pc->log, ngx_socket_errno, |
266 "connect(): %d", rc); | |
267 | |
167
8aef3c72e5da
nginx-0.0.1-2003-10-30-19:51:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
166
diff
changeset
|
268 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
|
269 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
|
270 ngx_blocking_n " failed"); |
3271
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
271 goto failed; |
167
8aef3c72e5da
nginx-0.0.1-2003-10-30-19:51:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
166
diff
changeset
|
272 } |
8aef3c72e5da
nginx-0.0.1-2003-10-30-19:51:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
166
diff
changeset
|
273 |
8aef3c72e5da
nginx-0.0.1-2003-10-30-19:51:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
166
diff
changeset
|
274 /* |
487 | 275 * 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
|
276 * NT does not support it. |
577 | 277 * |
169
edf29bb717da
nginx-0.0.1-2003-10-31-19:05:33 import
Igor Sysoev <igor@sysoev.ru>
parents:
168
diff
changeset
|
278 * 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
|
279 */ |
577 | 280 |
166
389d7ee9fa60
nginx-0.0.1-2003-10-30-11:51:06 import
Igor Sysoev <igor@sysoev.ru>
parents:
164
diff
changeset
|
281 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
|
282 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
|
283 |
164
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
162
diff
changeset
|
284 return NGX_OK; |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
162
diff
changeset
|
285 } |
84036764e215
nginx-0.0.1-2003-10-29-11:30:44 import
Igor Sysoev <igor@sysoev.ru>
parents:
162
diff
changeset
|
286 |
487 | 287 if (ngx_event_flags & NGX_USE_CLEAR_EVENT) { |
288 | |
289 /* kqueue */ | |
290 | |
137
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
291 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
|
292 |
487 | 293 } else { |
294 | |
295 /* select, poll, /dev/poll */ | |
296 | |
137
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
297 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
|
298 } |
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
299 |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
300 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
|
301 goto failed; |
162
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
302 } |
96993d4d5067
nginx-0.0.1-2003-10-28-00:01:00 import
Igor Sysoev <igor@sysoev.ru>
parents:
161
diff
changeset
|
303 |
137
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
304 if (rc == -1) { |
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
305 |
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
306 /* NGX_EINPROGRESS */ |
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 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
|
309 goto failed; |
137
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
310 } |
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
311 |
2a615b036870
nginx-0.0.1-2003-10-03-19:50:53 import
Igor Sysoev <igor@sysoev.ru>
parents:
136
diff
changeset
|
312 return NGX_AGAIN; |
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 |
257
70e1c7d2b83d
nginx-0.0.2-2004-02-11-20:08:49 import
Igor Sysoev <igor@sysoev.ru>
parents:
194
diff
changeset
|
315 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
|
316 |
148
5afee0074707
nginx-0.0.1-2003-10-17-00:19:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
144
diff
changeset
|
317 wev->ready = 1; |
5afee0074707
nginx-0.0.1-2003-10-17-00:19:16 import
Igor Sysoev <igor@sysoev.ru>
parents:
144
diff
changeset
|
318 |
136
da00cde00e8a
nginx-0.0.1-2003-10-02-09:39:37 import
Igor Sysoev <igor@sysoev.ru>
parents:
131
diff
changeset
|
319 return NGX_OK; |
3271
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
320 |
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
321 failed: |
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
322 |
4421
fbae1a82de8b
Fixed error handling in ngx_event_connect_peer().
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
323 ngx_close_connection(c); |
fbae1a82de8b
Fixed error handling in ngx_event_connect_peer().
Maxim Dounin <mdounin@mdounin.ru>
parents:
4412
diff
changeset
|
324 pc->connection = NULL; |
3271
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
325 |
fcd98af88df3
proxy_bind, fastcgi_bind, and memcached_bind
Igor Sysoev <igor@sysoev.ru>
parents:
2540
diff
changeset
|
326 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
|
327 } |
131
049e78b1f852
nginx-0.0.1-2003-08-14-10:00:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
124
diff
changeset
|
328 |
049e78b1f852
nginx-0.0.1-2003-08-14-10:00:28 import
Igor Sysoev <igor@sysoev.ru>
parents:
124
diff
changeset
|
329 |
6530
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
330 #if (NGX_HAVE_TRANSPARENT_PROXY) |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
331 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
332 static ngx_int_t |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
333 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
|
334 { |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
335 int value; |
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 value = 1; |
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 #if defined(SO_BINDANY) |
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 (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
|
342 (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
|
343 { |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
344 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
|
345 "setsockopt(SO_BINDANY) failed"); |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
346 return NGX_ERROR; |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
347 } |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
348 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
349 #else |
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 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
|
352 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
353 case AF_INET: |
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 #if defined(IP_TRANSPARENT) |
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 (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
|
358 (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
|
359 { |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
360 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
|
361 "setsockopt(IP_TRANSPARENT) failed"); |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
362 return NGX_ERROR; |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
363 } |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
364 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
365 #elif defined(IP_BINDANY) |
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 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
|
368 (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
|
369 { |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
370 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
|
371 "setsockopt(IP_BINDANY) failed"); |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
372 return NGX_ERROR; |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
373 } |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
374 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
375 #endif |
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 break; |
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 #if (NGX_HAVE_INET6) |
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 case AF_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 #if defined(IPV6_TRANSPARENT) |
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 (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
|
386 (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
|
387 { |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
388 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
|
389 "setsockopt(IPV6_TRANSPARENT) failed"); |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
390 return NGX_ERROR; |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
391 } |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
392 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
393 #elif defined(IPV6_BINDANY) |
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 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
|
396 (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
|
397 { |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
398 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
|
399 "setsockopt(IPV6_BINDANY) failed"); |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
400 return NGX_ERROR; |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
401 } |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
402 |
7217
8b70d4caa505
Generate error for unsupported IPv6 transparent proxy.
Roman Arutyunyan <arut@nginx.com>
parents:
6692
diff
changeset
|
403 #else |
8b70d4caa505
Generate error for unsupported IPv6 transparent proxy.
Roman Arutyunyan <arut@nginx.com>
parents:
6692
diff
changeset
|
404 |
8b70d4caa505
Generate error for unsupported IPv6 transparent proxy.
Roman Arutyunyan <arut@nginx.com>
parents:
6692
diff
changeset
|
405 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
|
406 "could not enable transparent proxying for IPv6 " |
8b70d4caa505
Generate error for unsupported IPv6 transparent proxy.
Roman Arutyunyan <arut@nginx.com>
parents:
6692
diff
changeset
|
407 "on this platform"); |
8b70d4caa505
Generate error for unsupported IPv6 transparent proxy.
Roman Arutyunyan <arut@nginx.com>
parents:
6692
diff
changeset
|
408 |
8b70d4caa505
Generate error for unsupported IPv6 transparent proxy.
Roman Arutyunyan <arut@nginx.com>
parents:
6692
diff
changeset
|
409 return NGX_ERROR; |
8b70d4caa505
Generate error for unsupported IPv6 transparent proxy.
Roman Arutyunyan <arut@nginx.com>
parents:
6692
diff
changeset
|
410 |
6530
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
411 #endif |
7217
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 break; |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
414 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
415 #endif /* NGX_HAVE_INET6 */ |
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 } |
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 #endif /* SO_BINDANY */ |
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 return NGX_OK; |
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 |
1d0e03db9f8e
Upstream: the "transparent" parameter of proxy_bind and friends.
Roman Arutyunyan <arut@nginx.com>
parents:
6436
diff
changeset
|
424 #endif |
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 |
884 | 427 ngx_int_t |
428 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
|
429 { |
884 | 430 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
|
431 } |