Mercurial > hg > nginx-quic
annotate src/event/ngx_event_acceptex.c @ 3167:7d1f9a449603
we do not need to increase request counter in this place,
the bug had appeared in r3115
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 28 Sep 2009 11:12:45 +0000 |
parents | ec5825afc7eb |
children | 00d436dbf826 |
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:
343
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:
343
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 |
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:
343
diff
changeset
|
4 */ |
da8c5707af39
nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
Igor Sysoev <igor@sysoev.ru>
parents:
343
diff
changeset
|
5 |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
6 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
7 #include <ngx_config.h> |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
8 #include <ngx_core.h> |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
9 #include <ngx_event.h> |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
10 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
11 |
543 | 12 static void ngx_close_posted_connection(ngx_connection_t *c); |
13 | |
14 | |
15 void | |
16 ngx_event_acceptex(ngx_event_t *rev) | |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
17 { |
2535
ec5825afc7eb
use variable for often used field
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
18 ngx_listening_t *ls; |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
19 ngx_connection_t *c; |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
20 |
461 | 21 c = rev->data; |
2535
ec5825afc7eb
use variable for often used field
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
22 ls = c->listening; |
461 | 23 |
543 | 24 c->log->handler = ngx_accept_log_error; |
25 | |
461 | 26 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "AcceptEx: %d", c->fd); |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
27 |
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
28 if (rev->ovlp.error) { |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
29 ngx_log_error(NGX_LOG_CRIT, c->log, rev->ovlp.error, |
2535
ec5825afc7eb
use variable for often used field
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
30 "AcceptEx() %V failed", &ls->addr_text); |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
31 return; |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
32 } |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
33 |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
34 /* SO_UPDATE_ACCEPT_CONTEXT is required for shutdown() to work */ |
93
738fe44c70d5
nginx-0.0.1-2003-05-21-17:28:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
35 |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
36 if (setsockopt(c->fd, SOL_SOCKET, SO_UPDATE_ACCEPT_CONTEXT, |
2535
ec5825afc7eb
use variable for often used field
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
37 (char *) &ls->fd, sizeof(ngx_socket_t)) |
1633
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
641
diff
changeset
|
38 == -1) |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
39 { |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
40 ngx_log_error(NGX_LOG_CRIT, c->log, ngx_socket_errno, |
461 | 41 "setsockopt(SO_UPDATE_ACCEPT_CONTEXT) failed for %V", |
42 &c->addr_text); | |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
43 } else { |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
44 c->accept_context_updated = 1; |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
45 } |
93
738fe44c70d5
nginx-0.0.1-2003-05-21-17:28:21 import
Igor Sysoev <igor@sysoev.ru>
parents:
92
diff
changeset
|
46 |
1633
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
641
diff
changeset
|
47 ngx_getacceptexsockaddrs(c->buffer->pos, |
2535
ec5825afc7eb
use variable for often used field
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
48 ls->post_accept_buffer_size, |
ec5825afc7eb
use variable for often used field
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
49 ls->socklen + 16, |
ec5825afc7eb
use variable for often used field
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
50 ls->socklen + 16, |
1633
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
641
diff
changeset
|
51 &c->local_sockaddr, &c->local_socklen, |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
641
diff
changeset
|
52 &c->sockaddr, &c->socklen); |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
53 |
2535
ec5825afc7eb
use variable for often used field
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
54 if (ls->post_accept_buffer_size) { |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
55 c->buffer->last += rev->available; |
2535
ec5825afc7eb
use variable for often used field
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
56 c->buffer->end = c->buffer->start + ls->post_accept_buffer_size; |
ec5825afc7eb
use variable for often used field
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
57 |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
58 } else { |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
59 c->buffer = NULL; |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
60 } |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
61 |
2535
ec5825afc7eb
use variable for often used field
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
62 if (ls->addr_ntop) { |
ec5825afc7eb
use variable for often used field
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
63 c->addr_text.data = ngx_pnalloc(c->pool, ls->addr_text_max_len); |
461 | 64 if (c->addr_text.data == NULL) { |
65 /* TODO: close socket */ | |
66 return; | |
67 } | |
68 | |
2198
5975975eedc0
ngx_sock_ntop() takes family from sockaddr, remove duplicate field
Igor Sysoev <igor@sysoev.ru>
parents:
2049
diff
changeset
|
69 c->addr_text.len = ngx_sock_ntop(c->sockaddr, c->addr_text.data, |
2535
ec5825afc7eb
use variable for often used field
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
70 ls->addr_text_max_len, 0); |
461 | 71 if (c->addr_text.len == 0) { |
72 /* TODO: close socket */ | |
73 return; | |
74 } | |
75 } | |
76 | |
2535
ec5825afc7eb
use variable for often used field
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
77 ngx_event_post_acceptex(ls, 1); |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
78 |
561 | 79 c->number = ngx_atomic_fetch_add(ngx_connection_counter, 1); |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
80 |
2535
ec5825afc7eb
use variable for often used field
Igor Sysoev <igor@sysoev.ru>
parents:
2512
diff
changeset
|
81 ls->handler(c); |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
82 |
100
7ebc8b7fb816
nginx-0.0.1-2003-06-03-19:42:58 import
Igor Sysoev <igor@sysoev.ru>
parents:
93
diff
changeset
|
83 return; |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
84 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
85 } |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
86 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
87 |
543 | 88 ngx_int_t |
89 ngx_event_post_acceptex(ngx_listening_t *ls, ngx_uint_t n) | |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
90 { |
280
7c7183b3ea8b
nginx-0.0.2-2004-03-05-11:34:24 import
Igor Sysoev <igor@sysoev.ru>
parents:
278
diff
changeset
|
91 u_long rcvd; |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
92 ngx_err_t err; |
543 | 93 ngx_log_t *log; |
94 ngx_uint_t i; | |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
95 ngx_event_t *rev, *wev; |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
96 ngx_socket_t s; |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
97 ngx_connection_t *c; |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
98 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
99 for (i = 0; i < n; i++) { |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
100 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
101 /* TODO: look up reused sockets */ |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
102 |
2198
5975975eedc0
ngx_sock_ntop() takes family from sockaddr, remove duplicate field
Igor Sysoev <igor@sysoev.ru>
parents:
2049
diff
changeset
|
103 s = ngx_socket(ls->sockaddr->sa_family, ls->type, 0); |
278
0ba4821f4460
nginx-0.0.2-2004-03-04-10:04:55 import
Igor Sysoev <igor@sysoev.ru>
parents:
166
diff
changeset
|
104 |
543 | 105 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, &ls->log, 0, |
461 | 106 ngx_socket_n " s:%d", s); |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
107 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
108 if (s == -1) { |
543 | 109 ngx_log_error(NGX_LOG_ALERT, &ls->log, ngx_socket_errno, |
110 ngx_socket_n " failed"); | |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
111 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
112 return NGX_ERROR; |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
113 } |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
114 |
543 | 115 c = ngx_get_connection(s, &ls->log); |
116 | |
117 if (c == NULL) { | |
118 return NGX_ERROR; | |
119 } | |
120 | |
121 c->pool = ngx_create_pool(ls->pool_size, &ls->log); | |
122 if (c->pool == NULL) { | |
123 ngx_close_posted_connection(c); | |
124 return NGX_ERROR; | |
125 } | |
126 | |
127 log = ngx_palloc(c->pool, sizeof(ngx_log_t)); | |
128 if (log == NULL) { | |
129 ngx_close_posted_connection(c); | |
130 return NGX_ERROR; | |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
131 } |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
132 |
543 | 133 c->buffer = ngx_create_temp_buf(c->pool, ls->post_accept_buffer_size |
134 + 2 * (ls->socklen + 16)); | |
135 if (c->buffer == NULL) { | |
136 ngx_close_posted_connection(c); | |
137 return NGX_ERROR; | |
138 } | |
139 | |
140 c->local_sockaddr = ngx_palloc(c->pool, ls->socklen); | |
141 if (c->local_sockaddr == NULL) { | |
142 ngx_close_posted_connection(c); | |
143 return NGX_ERROR; | |
144 } | |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
145 |
543 | 146 c->sockaddr = ngx_palloc(c->pool, ls->socklen); |
147 if (c->sockaddr == NULL) { | |
148 ngx_close_posted_connection(c); | |
149 return NGX_ERROR; | |
150 } | |
151 | |
152 *log = ls->log; | |
153 c->log = log; | |
154 | |
155 c->recv = ngx_recv; | |
156 c->send = ngx_send; | |
577 | 157 c->recv_chain = ngx_recv_chain; |
543 | 158 c->send_chain = ngx_send_chain; |
159 | |
160 c->unexpected_eof = 1; | |
161 | |
162 c->listening = ls; | |
163 | |
561 | 164 rev = c->read; |
165 wev = c->write; | |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
166 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
167 rev->ovlp.event = rev; |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
168 wev->ovlp.event = wev; |
509 | 169 rev->handler = ngx_event_acceptex; |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
170 |
461 | 171 rev->ready = 1; |
172 wev->ready = 1; | |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
173 |
543 | 174 rev->log = c->log; |
175 wev->log = c->log; | |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
176 |
102
7e86d028d8f0
nginx-0.0.1-2003-06-06-18:59:20 import
Igor Sysoev <igor@sysoev.ru>
parents:
100
diff
changeset
|
177 if (ngx_add_event(rev, 0, NGX_IOCP_IO) == NGX_ERROR) { |
543 | 178 ngx_close_posted_connection(c); |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
179 return NGX_ERROR; |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
180 } |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
181 |
1633
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
641
diff
changeset
|
182 if (ngx_acceptex(ls->fd, s, c->buffer->pos, ls->post_accept_buffer_size, |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
641
diff
changeset
|
183 ls->socklen + 16, ls->socklen + 16, |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
641
diff
changeset
|
184 &rcvd, (LPOVERLAPPED) &rev->ovlp) |
74b2a52bc3c9
TransmitPackets(), ConnectEx(), and DisconnectEx()
Igor Sysoev <igor@sysoev.ru>
parents:
641
diff
changeset
|
185 == 0) |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
186 { |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
187 err = ngx_socket_errno; |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
188 if (err != WSA_IO_PENDING) { |
543 | 189 ngx_log_error(NGX_LOG_ALERT, &ls->log, err, |
563 | 190 "AcceptEx() %V falied", &ls->addr_text); |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
191 |
543 | 192 ngx_close_posted_connection(c); |
103
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
193 return NGX_ERROR; |
6dfda4cf5200
nginx-0.0.1-2003-06-11-19:28:34 import
Igor Sysoev <igor@sysoev.ru>
parents:
102
diff
changeset
|
194 } |
59
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
195 } |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
196 } |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
197 |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
198 return NGX_OK; |
e8cdc2989cee
nginx-0.0.1-2003-02-06-20:21:13 import
Igor Sysoev <igor@sysoev.ru>
parents:
diff
changeset
|
199 } |
543 | 200 |
201 | |
202 static void | |
203 ngx_close_posted_connection(ngx_connection_t *c) | |
204 { | |
205 ngx_socket_t fd; | |
206 | |
207 ngx_free_connection(c); | |
208 | |
209 fd = c->fd; | |
210 c->fd = (ngx_socket_t) -1; | |
211 | |
212 if (ngx_close_socket(fd) == -1) { | |
213 ngx_log_error(NGX_LOG_ALERT, c->log, ngx_socket_errno, | |
214 ngx_close_socket_n " failed"); | |
215 } | |
216 | |
217 if (c->pool) { | |
218 ngx_destroy_pool(c->pool); | |
219 } | |
220 } | |
221 | |
222 | |
223 u_char * | |
224 ngx_acceptex_log_error(ngx_log_t *log, u_char *buf, size_t len) | |
225 { | |
226 return ngx_snprintf(buf, len, " while posting AcceptEx() on %V", log->data); | |
227 } |