Mercurial > hg > nginx
comparison src/core/nginx.c @ 111:1c002f2b77ed
nginx-0.0.1-2003-07-03-20:30:22 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 03 Jul 2003 16:30:22 +0000 |
parents | 152567c11325 |
children | d7f606e25b99 |
comparison
equal
deleted
inserted
replaced
110:152567c11325 | 111:1c002f2b77ed |
---|---|
20 int ngx_max_module; | 20 int ngx_max_module; |
21 | 21 |
22 int ngx_connection_counter; | 22 int ngx_connection_counter; |
23 | 23 |
24 | 24 |
25 #if 1 | 25 int restart; |
26 int rotate; | |
27 | |
26 | 28 |
27 int main(int argc, char *const *argv) | 29 int main(int argc, char *const *argv) |
28 { | 30 { |
29 int i; | 31 int i; |
30 ngx_log_t *log; | 32 ngx_log_t *log; |
51 /* daemon */ | 53 /* daemon */ |
52 | 54 |
53 /* life cycle */ | 55 /* life cycle */ |
54 | 56 |
55 for ( ;; ) { | 57 for ( ;; ) { |
58 /* STUB */ cycle->log->file->fd = log->file->fd; | |
59 /* STUB */ cycle->log->log_level = NGX_LOG_DEBUG; | |
56 | 60 |
57 /* STUB */ | 61 /* STUB */ |
58 ngx_io = ngx_os_io; | 62 ngx_io = ngx_os_io; |
59 | 63 |
60 /* forks */ | 64 /* forks */ |
64 /* STUB */ | 68 /* STUB */ |
65 ngx_pre_thread(&cycle->listening, cycle->pool, cycle->log); | 69 ngx_pre_thread(&cycle->listening, cycle->pool, cycle->log); |
66 | 70 |
67 /* threads */ | 71 /* threads */ |
68 | 72 |
73 restart = 0; | |
74 rotate = 0; | |
75 | |
69 for ( ;; ) { | 76 for ( ;; ) { |
70 | 77 |
71 ngx_worker(cycle); | 78 for ( ;; ) { |
79 ngx_log_debug(cycle->log, "worker cycle"); | |
80 | |
81 ngx_process_events(cycle->log); | |
82 | |
83 if (rotate) { | |
84 ngx_log_debug(cycle->log, "rotate"); | |
85 } | |
86 | |
87 if (restart) { | |
88 ngx_log_debug(cycle->log, "restart"); | |
89 break; | |
90 } | |
91 | |
92 } | |
72 | 93 |
73 new_cycle = ngx_init_cycle(cycle, cycle->log); | 94 new_cycle = ngx_init_cycle(cycle, cycle->log); |
74 if (new_cycle == NULL) { | 95 if (new_cycle == NULL) { |
75 continue; | 96 continue; |
76 } | 97 } |
314 return cycle; | 335 return cycle; |
315 } | 336 } |
316 | 337 |
317 | 338 |
318 | 339 |
319 #else | 340 #if 0 |
320 | 341 |
321 | 342 |
322 int main(int argc, char *const *argv) | 343 int main(int argc, char *const *argv) |
323 { | 344 { |
324 int i; | 345 int i; |