nevents = dpcf->events;
- if (ngx_event_timer_init(cycle) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
ngx_io = ngx_os_io;
ngx_event_actions = ngx_devpoll_module_ctx.actions;
dp = -1;
- ngx_event_timer_done(cycle);
-
ngx_free(change_list);
ngx_free(event_list);
ngx_free(change_index);
/*
- * Copyright (C) 2002-2003 Igor Sysoev, http://sysoev.ru/en/
+ * Copyright (C) 2002-2004 Igor Sysoev, http://sysoev.ru/en/
*/
nevents = kcf->events;
- if (ngx_event_timer_init(cycle) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
ngx_io = ngx_os_io;
ngx_event_actions = ngx_kqueue_module_ctx.actions;
ngx_kqueue = -1;
- ngx_event_timer_done(cycle);
-
ngx_free(change_list);
ngx_free(event_list);
NGX_ERROR);
}
- if (ngx_event_timer_init(cycle) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
ngx_io = ngx_os_io;
ngx_event_actions = ngx_poll_module_ctx.actions;
static void ngx_poll_done(ngx_cycle_t *cycle)
{
- ngx_event_timer_done(cycle);
-
ngx_free(event_list);
ngx_free(event_index);
ngx_free(ready_index);
/*
- * Copyright (C) 2002-2003 Igor Sysoev, http://sysoev.ru
+ * Copyright (C) 2002-2004 Igor Sysoev, http://sysoev.ru/en/
*/
NGX_ERROR);
}
- if (ngx_event_timer_init(cycle) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
ngx_io = ngx_os_io;
ngx_event_actions = ngx_select_module_ctx.actions;
static void ngx_select_done(ngx_cycle_t *cycle)
{
- ngx_event_timer_done(cycle);
-
ngx_free(event_index);
ngx_free(ready_index);
work_write_fd_set = master_write_fd_set;
timer = ngx_event_find_timer();
+ ngx_old_elapsed_msec = ngx_elapsed_msec;
if (timer) {
#if (HAVE_SELECT_CHANGE_TIMEOUT)
#endif
- if (cycle->old_cycle == NULL) {
- ngx_event_timer_init(cycle);
- }
-
+ ngx_event_timer_init();
ecf = ngx_event_get_conf(cycle->conf_ctx, ngx_event_core_module);
ngx_rbtree_t ngx_event_timer_sentinel;
-int ngx_event_timer_init(ngx_cycle_t *cycle)
+void ngx_event_timer_init(void)
{
if (ngx_event_timer_rbtree) {
- return NGX_OK;
+ return;
}
ngx_event_timer_rbtree = &ngx_event_timer_sentinel;
-
-#if 0
- ngx_event_timer_sentinel.left = &ngx_event_timer_sentinel;
- ngx_event_timer_sentinel.right = &ngx_event_timer_sentinel;
- ngx_event_timer_sentinel.parent = &ngx_event_timer_sentinel;
-#endif
-
- return NGX_OK;
-}
-
-
-void ngx_event_timer_done(ngx_cycle_t *cycle)
-{
}
#define NGX_TIMER_RESOLUTION 1
-#if 0
-int ngx_event_timer_init(void);
-#endif
-/* STUB */ int ngx_event_timer_init(ngx_cycle_t *cycle);
-/* STUB */ void ngx_event_timer_done(ngx_cycle_t *cycle);
-
+void ngx_event_timer_init(void);
ngx_msec_t ngx_event_find_timer(void);
void ngx_event_expire_timers(ngx_msec_t timer);
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
- if (r->keepalive != 0 && clcf->keepalive_timeout > 0) {
+ if (!ngx_terminate
+ && !ngx_quit
+ && r->keepalive != 0
+ && clcf->keepalive_timeout > 0)
+ {
ngx_http_set_keepalive(r);
+ return;
} else if (r->lingering_close && clcf->lingering_timeout > 0) {
ngx_http_set_lingering_close(r);
-
- } else {
- ngx_http_close_request(r, 0);
- ngx_http_close_connection(r->connection);
+ return;
}
- return;
+ ngx_http_close_request(r, 0);
+ ngx_http_close_connection(r->connection);
}