Mercurial > hg > nginx-quic
annotate src/core/ngx_connection.h @ 6682:db422604ceb0
Stream: allow using the session context inside handlers.
Previously, it was not possible to use the stream context
inside ngx_stream_init_connection() handlers. Now, limit_conn,
access handlers, as well as those added later, can create
their own contexts.
author | Dmitry Volyntsev <xeioex@nginx.com> |
---|---|
date | Tue, 06 Sep 2016 21:28:17 +0300 |
parents | bcd442b585f0 |
children | cebf5fed00bf |
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:
432
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:
432
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:
432
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:
432
diff
changeset
|
6 |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
432
diff
changeset
|
7 |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
8 #ifndef _NGX_CONNECTION_H_INCLUDED_ |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 #define _NGX_CONNECTION_H_INCLUDED_ |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
101
diff
changeset
|
11 |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
99
diff
changeset
|
12 #include <ngx_config.h> |
92
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
13 #include <ngx_core.h> |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
101
diff
changeset
|
14 |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
101
diff
changeset
|
15 |
543 | 16 typedef struct ngx_listening_s ngx_listening_t; |
17 | |
18 struct ngx_listening_s { | |
19 ngx_socket_t fd; | |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
101
diff
changeset
|
20 |
543 | 21 struct sockaddr *sockaddr; |
22 socklen_t socklen; /* size of sockaddr */ | |
23 size_t addr_text_max_len; | |
24 ngx_str_t addr_text; | |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
101
diff
changeset
|
25 |
543 | 26 int type; |
563 | 27 |
543 | 28 int backlog; |
563 | 29 int rcvbuf; |
30 int sndbuf; | |
4323
c4513d4dd024
Added the "so_keepalive=" parameter to the "listen" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
3880
diff
changeset
|
31 #if (NGX_HAVE_KEEPALIVE_TUNABLE) |
c4513d4dd024
Added the "so_keepalive=" parameter to the "listen" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
3880
diff
changeset
|
32 int keepidle; |
c4513d4dd024
Added the "so_keepalive=" parameter to the "listen" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
3880
diff
changeset
|
33 int keepintvl; |
c4513d4dd024
Added the "so_keepalive=" parameter to the "listen" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
3880
diff
changeset
|
34 int keepcnt; |
c4513d4dd024
Added the "so_keepalive=" parameter to the "listen" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
3880
diff
changeset
|
35 #endif |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
101
diff
changeset
|
36 |
543 | 37 /* handler of accepted connection */ |
547 | 38 ngx_connection_handler_pt handler; |
543 | 39 |
40 void *servers; /* array of ngx_http_in_addr_t, for example */ | |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
101
diff
changeset
|
41 |
543 | 42 ngx_log_t log; |
2785
d478379e51ac
*) refactor error_log processing: listen socket log might inherit built-in
Igor Sysoev <igor@sysoev.ru>
parents:
2562
diff
changeset
|
43 ngx_log_t *logp; |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
101
diff
changeset
|
44 |
543 | 45 size_t pool_size; |
46 /* should be here because of the AcceptEx() preread */ | |
47 size_t post_accept_buffer_size; | |
48 /* should be here because of the deferred accept */ | |
557 | 49 ngx_msec_t post_accept_timeout; |
543 | 50 |
51 ngx_listening_t *previous; | |
52 ngx_connection_t *connection; | |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
101
diff
changeset
|
53 |
6153
4f6efabcb09b
The "reuseport" option of the "listen" directive.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6129
diff
changeset
|
54 ngx_uint_t worker; |
4f6efabcb09b
The "reuseport" option of the "listen" directive.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6129
diff
changeset
|
55 |
543 | 56 unsigned open:1; |
57 unsigned remain:1; | |
58 unsigned ignore:1; | |
109
a9bc21d63fe4
nginx-0.0.1-2003-07-02-18:41:17 import
Igor Sysoev <igor@sysoev.ru>
parents:
103
diff
changeset
|
59 |
543 | 60 unsigned bound:1; /* already bound */ |
61 unsigned inherited:1; /* inherited from previous process */ | |
62 unsigned nonblocking_accept:1; | |
563 | 63 unsigned listen:1; |
543 | 64 unsigned nonblocking:1; |
65 unsigned shared:1; /* shared between threads or processes */ | |
66 unsigned addr_ntop:1; | |
6436 | 67 unsigned wildcard:1; |
523 | 68 |
2562 | 69 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY) |
4771
bdcdbdf35b52
Core: ipv6only is now on by default.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
70 unsigned ipv6only:1; |
2562 | 71 #endif |
6153
4f6efabcb09b
The "reuseport" option of the "listen" directive.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6129
diff
changeset
|
72 #if (NGX_HAVE_REUSEPORT) |
4f6efabcb09b
The "reuseport" option of the "listen" directive.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6129
diff
changeset
|
73 unsigned reuseport:1; |
4f6efabcb09b
The "reuseport" option of the "listen" directive.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6129
diff
changeset
|
74 unsigned add_reuseport:1; |
4f6efabcb09b
The "reuseport" option of the "listen" directive.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6129
diff
changeset
|
75 #endif |
4323
c4513d4dd024
Added the "so_keepalive=" parameter to the "listen" directive.
Valentin Bartenev <vbart@nginx.com>
parents:
3880
diff
changeset
|
76 unsigned keepalive:2; |
2562 | 77 |
469 | 78 #if (NGX_HAVE_DEFERRED_ACCEPT) |
543 | 79 unsigned deferred_accept:1; |
80 unsigned delete_deferred:1; | |
81 unsigned add_deferred:1; | |
523 | 82 #ifdef SO_ACCEPTFILTER |
543 | 83 char *accept_filter; |
523 | 84 #endif |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
101
diff
changeset
|
85 #endif |
3676 | 86 #if (NGX_HAVE_SETFIB) |
87 int setfib; | |
88 #endif | |
419
47709bff4468
nginx-0.0.10-2004-09-09-19:40:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
417
diff
changeset
|
89 |
5456
692afcea9d0d
Added support for TCP_FASTOPEN supported in Linux >= 3.7.1.
Mathew Rodley <mathew@rodley.com.au>
parents:
5104
diff
changeset
|
90 #if (NGX_HAVE_TCP_FASTOPEN) |
692afcea9d0d
Added support for TCP_FASTOPEN supported in Linux >= 3.7.1.
Mathew Rodley <mathew@rodley.com.au>
parents:
5104
diff
changeset
|
91 int fastopen; |
692afcea9d0d
Added support for TCP_FASTOPEN supported in Linux >= 3.7.1.
Mathew Rodley <mathew@rodley.com.au>
parents:
5104
diff
changeset
|
92 #endif |
692afcea9d0d
Added support for TCP_FASTOPEN supported in Linux >= 3.7.1.
Mathew Rodley <mathew@rodley.com.au>
parents:
5104
diff
changeset
|
93 |
543 | 94 }; |
92
19cc647ecd91
nginx-0.0.1-2003-05-20-19:37:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
91
diff
changeset
|
95 |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
96 |
256
8e39cab6abd5
nginx-0.0.2-2004-02-10-19:23:38 import
Igor Sysoev <igor@sysoev.ru>
parents:
253
diff
changeset
|
97 typedef enum { |
6474 | 98 NGX_ERROR_ALERT = 0, |
99 NGX_ERROR_ERR, | |
100 NGX_ERROR_INFO, | |
101 NGX_ERROR_IGNORE_ECONNRESET, | |
102 NGX_ERROR_IGNORE_EINVAL | |
256
8e39cab6abd5
nginx-0.0.2-2004-02-10-19:23:38 import
Igor Sysoev <igor@sysoev.ru>
parents:
253
diff
changeset
|
103 } ngx_connection_log_error_e; |
8e39cab6abd5
nginx-0.0.2-2004-02-10-19:23:38 import
Igor Sysoev <igor@sysoev.ru>
parents:
253
diff
changeset
|
104 |
8e39cab6abd5
nginx-0.0.2-2004-02-10-19:23:38 import
Igor Sysoev <igor@sysoev.ru>
parents:
253
diff
changeset
|
105 |
344
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
106 typedef enum { |
6474 | 107 NGX_TCP_NODELAY_UNSET = 0, |
108 NGX_TCP_NODELAY_SET, | |
109 NGX_TCP_NODELAY_DISABLED | |
483 | 110 } ngx_connection_tcp_nodelay_e; |
111 | |
112 | |
113 typedef enum { | |
6474 | 114 NGX_TCP_NOPUSH_UNSET = 0, |
115 NGX_TCP_NOPUSH_SET, | |
116 NGX_TCP_NOPUSH_DISABLED | |
344
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
117 } ngx_connection_tcp_nopush_e; |
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
118 |
e366ba5db8f8
nginx-0.0.3-2004-06-01-10:04:46 import
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
119 |
829
362d156f0278
high level HTTP buffered flags should be on per-subrequest basis,
Igor Sysoev <igor@sysoev.ru>
parents:
641
diff
changeset
|
120 #define NGX_LOWLEVEL_BUFFERED 0x0f |
362d156f0278
high level HTTP buffered flags should be on per-subrequest basis,
Igor Sysoev <igor@sysoev.ru>
parents:
641
diff
changeset
|
121 #define NGX_SSL_BUFFERED 0x01 |
6246
257b51c37c5a
The HTTP/2 implementation (RFC 7240, 7241).
Valentin Bartenev <vbart@nginx.com>
parents:
6220
diff
changeset
|
122 #define NGX_HTTP_V2_BUFFERED 0x02 |
597 | 123 |
124 | |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
125 struct ngx_connection_s { |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
393
diff
changeset
|
126 void *data; |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
393
diff
changeset
|
127 ngx_event_t *read; |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
393
diff
changeset
|
128 ngx_event_t *write; |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
101
diff
changeset
|
129 |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
393
diff
changeset
|
130 ngx_socket_t fd; |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
101
diff
changeset
|
131 |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
393
diff
changeset
|
132 ngx_recv_pt recv; |
539 | 133 ngx_send_pt send; |
577 | 134 ngx_recv_chain_pt recv_chain; |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
393
diff
changeset
|
135 ngx_send_chain_pt send_chain; |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
393
diff
changeset
|
136 |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
393
diff
changeset
|
137 ngx_listening_t *listening; |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
138 |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
393
diff
changeset
|
139 off_t sent; |
8
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
7
diff
changeset
|
140 |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
393
diff
changeset
|
141 ngx_log_t *log; |
57
a499e0d1f16e
nginx-0.0.1-2003-01-30-10:28:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
44
diff
changeset
|
142 |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
393
diff
changeset
|
143 ngx_pool_t *pool; |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
101
diff
changeset
|
144 |
6436 | 145 int type; |
146 | |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
393
diff
changeset
|
147 struct sockaddr *sockaddr; |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
393
diff
changeset
|
148 socklen_t socklen; |
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
393
diff
changeset
|
149 ngx_str_t addr_text; |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
101
diff
changeset
|
150 |
5605
3a72b1805c52
Added server-side support for PROXY protocol v1 (ticket #355).
Roman Arutyunyan <arut@nginx.com>
parents:
5513
diff
changeset
|
151 ngx_str_t proxy_protocol_addr; |
6561
28c76d9d75b7
Added the $proxy_protocol_port variable.
Dmitry Volyntsev <xeioex@nginx.com>
parents:
6555
diff
changeset
|
152 in_port_t proxy_protocol_port; |
5605
3a72b1805c52
Added server-side support for PROXY protocol v1 (ticket #355).
Roman Arutyunyan <arut@nginx.com>
parents:
5513
diff
changeset
|
153 |
577 | 154 #if (NGX_SSL) |
547 | 155 ngx_ssl_connection_t *ssl; |
392
d1222d46b3f9
nginx-0.0.7-2004-07-15-00:07:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
380
diff
changeset
|
156 #endif |
d1222d46b3f9
nginx-0.0.7-2004-07-15-00:07:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
380
diff
changeset
|
157 |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
393
diff
changeset
|
158 struct sockaddr *local_sockaddr; |
5463
1ab1cf63f885
Core: keep the length of the local sockaddr.
Ruslan Ermilov <ru@nginx.com>
parents:
5456
diff
changeset
|
159 socklen_t local_socklen; |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
101
diff
changeset
|
160 |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
393
diff
changeset
|
161 ngx_buf_t *buffer; |
8
708f8bb772ec
nginx-0.0.1-2002-09-02-18:48:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
7
diff
changeset
|
162 |
3880
e3cb8e27e413
reuse keepalive connections if there are no free worker connections
Igor Sysoev <igor@sysoev.ru>
parents:
3676
diff
changeset
|
163 ngx_queue_t queue; |
e3cb8e27e413
reuse keepalive connections if there are no free worker connections
Igor Sysoev <igor@sysoev.ru>
parents:
3676
diff
changeset
|
164 |
495 | 165 ngx_atomic_uint_t number; |
26
53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
Igor Sysoev <igor@sysoev.ru>
parents:
24
diff
changeset
|
166 |
2888 | 167 ngx_uint_t requests; |
168 | |
829
362d156f0278
high level HTTP buffered flags should be on per-subrequest basis,
Igor Sysoev <igor@sysoev.ru>
parents:
641
diff
changeset
|
169 unsigned buffered:8; |
597 | 170 |
2560
a7443674e429
ignore EINVAL from setsockopt() on Solaris
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
171 unsigned log_error:3; /* ngx_connection_log_error_e */ |
256
8e39cab6abd5
nginx-0.0.2-2004-02-10-19:23:38 import
Igor Sysoev <igor@sysoev.ru>
parents:
253
diff
changeset
|
172 |
396
6f3b20c1ac50
nginx-0.0.7-2004-07-18-23:11:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
393
diff
changeset
|
173 unsigned timedout:1; |
583 | 174 unsigned error:1; |
175 unsigned destroyed:1; | |
452 | 176 |
1135
03f1133f24e8
close keep-alive connections in the shuting down processes
Igor Sysoev <igor@sysoev.ru>
parents:
829
diff
changeset
|
177 unsigned idle:1; |
3880
e3cb8e27e413
reuse keepalive connections if there are no free worker connections
Igor Sysoev <igor@sysoev.ru>
parents:
3676
diff
changeset
|
178 unsigned reusable:1; |
1135
03f1133f24e8
close keep-alive connections in the shuting down processes
Igor Sysoev <igor@sysoev.ru>
parents:
829
diff
changeset
|
179 unsigned close:1; |
6436 | 180 unsigned shared:1; |
1135
03f1133f24e8
close keep-alive connections in the shuting down processes
Igor Sysoev <igor@sysoev.ru>
parents:
829
diff
changeset
|
181 |
452 | 182 unsigned sendfile:1; |
183 unsigned sndlowat:1; | |
483 | 184 unsigned tcp_nodelay:2; /* ngx_connection_tcp_nodelay_e */ |
185 unsigned tcp_nopush:2; /* ngx_connection_tcp_nopush_e */ | |
452 | 186 |
5513
311803b21504
SPDY: body filter was replaced by c->send_chain() function.
Valentin Bartenev <vbart@nginx.com>
parents:
5498
diff
changeset
|
187 unsigned need_last_buf:1; |
311803b21504
SPDY: body filter was replaced by c->send_chain() function.
Valentin Bartenev <vbart@nginx.com>
parents:
5498
diff
changeset
|
188 |
3065 | 189 #if (NGX_HAVE_AIO_SENDFILE) |
5498
d39a69427056
Allowed up to two EBUSY errors from sendfile().
Maxim Dounin <mdounin@mdounin.ru>
parents:
5463
diff
changeset
|
190 unsigned busy_count:2; |
3065 | 191 #endif |
192 | |
6023
b550563ef96e
Added support for offloading Linux sendfile() in thread pools.
Valentin Bartenev <vbart@nginx.com>
parents:
6016
diff
changeset
|
193 #if (NGX_THREADS) |
b550563ef96e
Added support for offloading Linux sendfile() in thread pools.
Valentin Bartenev <vbart@nginx.com>
parents:
6016
diff
changeset
|
194 ngx_thread_task_t *sendfile_task; |
b550563ef96e
Added support for offloading Linux sendfile() in thread pools.
Valentin Bartenev <vbart@nginx.com>
parents:
6016
diff
changeset
|
195 #endif |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
196 }; |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
197 |
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
198 |
6129
187aa751ad62
Core: the ngx_set_connection_log() macro.
Vladimir Homutov <vl@nginx.com>
parents:
6031
diff
changeset
|
199 #define ngx_set_connection_log(c, l) \ |
187aa751ad62
Core: the ngx_set_connection_log() macro.
Vladimir Homutov <vl@nginx.com>
parents:
6031
diff
changeset
|
200 \ |
187aa751ad62
Core: the ngx_set_connection_log() macro.
Vladimir Homutov <vl@nginx.com>
parents:
6031
diff
changeset
|
201 c->log->file = l->file; \ |
187aa751ad62
Core: the ngx_set_connection_log() macro.
Vladimir Homutov <vl@nginx.com>
parents:
6031
diff
changeset
|
202 c->log->next = l->next; \ |
187aa751ad62
Core: the ngx_set_connection_log() macro.
Vladimir Homutov <vl@nginx.com>
parents:
6031
diff
changeset
|
203 c->log->writer = l->writer; \ |
187aa751ad62
Core: the ngx_set_connection_log() macro.
Vladimir Homutov <vl@nginx.com>
parents:
6031
diff
changeset
|
204 c->log->wdata = l->wdata; \ |
187aa751ad62
Core: the ngx_set_connection_log() macro.
Vladimir Homutov <vl@nginx.com>
parents:
6031
diff
changeset
|
205 if (!(c->log->log_level & NGX_LOG_DEBUG_CONNECTION)) { \ |
187aa751ad62
Core: the ngx_set_connection_log() macro.
Vladimir Homutov <vl@nginx.com>
parents:
6031
diff
changeset
|
206 c->log->log_level = l->log_level; \ |
187aa751ad62
Core: the ngx_set_connection_log() macro.
Vladimir Homutov <vl@nginx.com>
parents:
6031
diff
changeset
|
207 } |
187aa751ad62
Core: the ngx_set_connection_log() macro.
Vladimir Homutov <vl@nginx.com>
parents:
6031
diff
changeset
|
208 |
187aa751ad62
Core: the ngx_set_connection_log() macro.
Vladimir Homutov <vl@nginx.com>
parents:
6031
diff
changeset
|
209 |
6555
090a78da4f88
Belatedly changed the ngx_create_listening() prototype.
Ruslan Ermilov <ru@nginx.com>
parents:
6532
diff
changeset
|
210 ngx_listening_t *ngx_create_listening(ngx_conf_t *cf, struct sockaddr *sockaddr, |
2806 | 211 socklen_t socklen); |
6153
4f6efabcb09b
The "reuseport" option of the "listen" directive.
Maxim Dounin <mdounin@mdounin.ru>
parents:
6129
diff
changeset
|
212 ngx_int_t ngx_clone_listening(ngx_conf_t *cf, ngx_listening_t *ls); |
219
f57597ec5249
nginx-0.0.1-2004-01-06-19:49:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
218
diff
changeset
|
213 ngx_int_t ngx_set_inherited_sockets(ngx_cycle_t *cycle); |
218
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
216
diff
changeset
|
214 ngx_int_t ngx_open_listening_sockets(ngx_cycle_t *cycle); |
2802 | 215 void ngx_configure_listening_sockets(ngx_cycle_t *cycle); |
218
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
216
diff
changeset
|
216 void ngx_close_listening_sockets(ngx_cycle_t *cycle); |
417
0526206251f6
nginx-0.0.10-2004-09-07-19:29:22 import
Igor Sysoev <igor@sysoev.ru>
parents:
399
diff
changeset
|
217 void ngx_close_connection(ngx_connection_t *c); |
6220
5e6142609e48
Core: idle connections now closed only once on exiting.
Valentin Bartenev <vbart@nginx.com>
parents:
6153
diff
changeset
|
218 void ngx_close_idle_connections(ngx_cycle_t *cycle); |
2854
d788477f5a67
ngx_connection_local_sockaddr()
Igor Sysoev <igor@sysoev.ru>
parents:
2806
diff
changeset
|
219 ngx_int_t ngx_connection_local_sockaddr(ngx_connection_t *c, ngx_str_t *s, |
d788477f5a67
ngx_connection_local_sockaddr()
Igor Sysoev <igor@sysoev.ru>
parents:
2806
diff
changeset
|
220 ngx_uint_t port); |
253
b6793bc5034b
nginx-0.0.2-2004-02-09-10:46:43 import
Igor Sysoev <igor@sysoev.ru>
parents:
219
diff
changeset
|
221 ngx_int_t ngx_connection_error(ngx_connection_t *c, ngx_err_t err, char *text); |
218
05592fd7a436
nginx-0.0.1-2004-01-05-23:55:48 import
Igor Sysoev <igor@sysoev.ru>
parents:
216
diff
changeset
|
222 |
543 | 223 ngx_connection_t *ngx_get_connection(ngx_socket_t s, ngx_log_t *log); |
224 void ngx_free_connection(ngx_connection_t *c); | |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
225 |
3880
e3cb8e27e413
reuse keepalive connections if there are no free worker connections
Igor Sysoev <igor@sysoev.ru>
parents:
3676
diff
changeset
|
226 void ngx_reusable_connection(ngx_connection_t *c, ngx_uint_t reusable); |
91
637625a2acdb
nginx-0.0.1-2003-05-19-20:39:14 import
Igor Sysoev <igor@sysoev.ru>
parents:
87
diff
changeset
|
227 |
0
4eff17414a43
nginx-0.0.1-2002-08-06-20:39:45 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
228 #endif /* _NGX_CONNECTION_H_INCLUDED_ */ |