Mercurial > hg > nginx-quic
comparison src/core/ngx_connection.c @ 290:87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 16 Mar 2004 07:10:12 +0000 |
parents | f81d075ad172 |
children | 00c5660d2707 |
comparison
equal
deleted
inserted
replaced
289:0750faf8d7e3 | 290:87e73f067470 |
---|---|
7 ngx_os_io_t ngx_io; | 7 ngx_os_io_t ngx_io; |
8 | 8 |
9 | 9 |
10 ngx_int_t ngx_set_inherited_sockets(ngx_cycle_t *cycle) | 10 ngx_int_t ngx_set_inherited_sockets(ngx_cycle_t *cycle) |
11 { | 11 { |
12 ngx_int_t i; | 12 ngx_uint_t i; |
13 ngx_listening_t *ls; | 13 ngx_listening_t *ls; |
14 struct sockaddr_in *addr_in; | 14 struct sockaddr_in *addr_in; |
15 | 15 |
16 ls = cycle->listening.elts; | 16 ls = cycle->listening.elts; |
17 for (i = 0; i < cycle->listening.nelts; i++) { | 17 for (i = 0; i < cycle->listening.nelts; i++) { |
61 } | 61 } |
62 | 62 |
63 | 63 |
64 ngx_int_t ngx_open_listening_sockets(ngx_cycle_t *cycle) | 64 ngx_int_t ngx_open_listening_sockets(ngx_cycle_t *cycle) |
65 { | 65 { |
66 ngx_int_t tries, failed, reuseaddr, i; | 66 ngx_uint_t tries, failed, reuseaddr, i; |
67 ngx_err_t err; | 67 ngx_err_t err; |
68 ngx_log_t *log; | 68 ngx_log_t *log; |
69 ngx_socket_t s; | 69 ngx_socket_t s; |
70 ngx_listening_t *ls; | 70 ngx_listening_t *ls; |
71 | 71 |
76 | 76 |
77 log = cycle->log; | 77 log = cycle->log; |
78 | 78 |
79 /* TODO: tries configurable */ | 79 /* TODO: tries configurable */ |
80 | 80 |
81 for (tries = /* STUB */ 1; tries; tries--) { | 81 for (tries = /* STUB */ 5; tries; tries--) { |
82 failed = 0; | 82 failed = 0; |
83 | 83 |
84 /* for each listening socket */ | 84 /* for each listening socket */ |
85 | 85 |
86 ls = cycle->listening.elts; | 86 ls = cycle->listening.elts; |
202 } | 202 } |
203 | 203 |
204 | 204 |
205 void ngx_close_listening_sockets(ngx_cycle_t *cycle) | 205 void ngx_close_listening_sockets(ngx_cycle_t *cycle) |
206 { | 206 { |
207 ngx_int_t i; | 207 ngx_uint_t i; |
208 ngx_socket_t fd; | 208 ngx_socket_t fd; |
209 ngx_listening_t *ls; | 209 ngx_listening_t *ls; |
210 | 210 |
211 if (ngx_event_flags & NGX_USE_IOCP_EVENT) { | 211 if (ngx_event_flags & NGX_USE_IOCP_EVENT) { |
212 return; | 212 return; |
231 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_socket_errno, | 231 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_socket_errno, |
232 ngx_close_socket_n " %s failed", | 232 ngx_close_socket_n " %s failed", |
233 ls[i].addr_text.data); | 233 ls[i].addr_text.data); |
234 } | 234 } |
235 | 235 |
236 cycle->connections[fd].fd = -1; | 236 cycle->connections[fd].fd = (ngx_socket_t) -1; |
237 } | 237 } |
238 } | 238 } |
239 | 239 |
240 | 240 |
241 ngx_int_t ngx_connection_error(ngx_connection_t *c, ngx_err_t err, char *text) | 241 ngx_int_t ngx_connection_error(ngx_connection_t *c, ngx_err_t err, char *text) |