Mercurial > hg > nginx-quic
comparison src/core/nginx.c @ 26:53cb81681040
nginx-0.0.1-2002-12-15-09:25:09 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 15 Dec 2002 06:25:09 +0000 |
parents | 77c7629a2627 |
children | d45effe5854c |
comparison
equal
deleted
inserted
replaced
25:a8b156554dfe | 26:53cb81681040 |
---|---|
30 | 30 |
31 ngx_log_t ngx_log; | 31 ngx_log_t ngx_log; |
32 ngx_pool_t *ngx_pool; | 32 ngx_pool_t *ngx_pool; |
33 | 33 |
34 | 34 |
35 int ngx_connection_counter; | |
36 | |
35 ngx_array_t *ngx_listening_sockets; | 37 ngx_array_t *ngx_listening_sockets; |
36 | 38 |
37 | 39 |
38 int main(int argc, char *const *argv) | 40 int main(int argc, char *const *argv) |
39 { | 41 { |
41 ngx_log.log_level = NGX_LOG_DEBUG; | 43 ngx_log.log_level = NGX_LOG_DEBUG; |
42 | 44 |
43 ngx_pool = ngx_create_pool(16 * 1024, &ngx_log); | 45 ngx_pool = ngx_create_pool(16 * 1024, &ngx_log); |
44 /* */ | 46 /* */ |
45 | 47 |
48 #if !(WIN32) | |
46 ngx_set_signals(&ngx_log); | 49 ngx_set_signals(&ngx_log); |
50 #endif | |
47 | 51 |
48 ngx_init_sockets(&ngx_log); | 52 ngx_init_sockets(&ngx_log); |
49 | 53 |
50 /* TODO: read config */ | 54 /* TODO: read config */ |
51 | 55 |
71 ngx_worker(&ngx_log); | 75 ngx_worker(&ngx_log); |
72 | 76 |
73 return 0; | 77 return 0; |
74 } | 78 } |
75 | 79 |
80 #if !(WIN32) | |
76 static void ngx_set_signals(ngx_log_t *log) | 81 static void ngx_set_signals(ngx_log_t *log) |
77 { | 82 { |
78 struct sigaction sa; | 83 struct sigaction sa; |
79 | 84 |
80 ngx_memzero(&sa, sizeof(struct sigaction)); | 85 ngx_memzero(&sa, sizeof(struct sigaction)); |
84 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, | 89 ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, |
85 "sigaction(SIGPIPE, SIG_IGN) failed"); | 90 "sigaction(SIGPIPE, SIG_IGN) failed"); |
86 exit(1); | 91 exit(1); |
87 } | 92 } |
88 } | 93 } |
94 #endif | |
89 | 95 |
90 static void ngx_open_listening_sockets(ngx_log_t *log) | 96 static void ngx_open_listening_sockets(ngx_log_t *log) |
91 { | 97 { |
92 int times, failed, reuseaddr, i; | 98 int times, failed, reuseaddr, i; |
93 ngx_err_t err; | 99 ngx_err_t err; |