mirror of
https://github.com/nginx/nginx.git
synced 2024-12-20 06:03:31 -06:00
nginx-0.0.1-2004-01-16-09:15:48 import
This commit is contained in:
parent
b10b0ee130
commit
c599198d83
@ -165,10 +165,6 @@ ngx_log_debug(cycle->log, "EV: %d" _ dpcf->events);
|
||||
|
||||
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;
|
||||
@ -188,8 +184,6 @@ static void ngx_devpoll_done(ngx_cycle_t *cycle)
|
||||
|
||||
dp = -1;
|
||||
|
||||
ngx_event_timer_done(cycle);
|
||||
|
||||
ngx_free(change_list);
|
||||
ngx_free(event_list);
|
||||
ngx_free(change_index);
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002-2003 Igor Sysoev, http://sysoev.ru/en/
|
||||
* Copyright (C) 2002-2004 Igor Sysoev, http://sysoev.ru/en/
|
||||
*/
|
||||
|
||||
|
||||
@ -142,10 +142,6 @@ static int ngx_kqueue_init(ngx_cycle_t *cycle)
|
||||
|
||||
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;
|
||||
@ -174,8 +170,6 @@ static void ngx_kqueue_done(ngx_cycle_t *cycle)
|
||||
|
||||
ngx_kqueue = -1;
|
||||
|
||||
ngx_event_timer_done(cycle);
|
||||
|
||||
ngx_free(change_list);
|
||||
ngx_free(event_list);
|
||||
|
||||
|
@ -101,10 +101,6 @@ static int ngx_poll_init(ngx_cycle_t *cycle)
|
||||
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;
|
||||
@ -117,8 +113,6 @@ static int ngx_poll_init(ngx_cycle_t *cycle)
|
||||
|
||||
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);
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
/*
|
||||
* Copyright (C) 2002-2003 Igor Sysoev, http://sysoev.ru
|
||||
* Copyright (C) 2002-2004 Igor Sysoev, http://sysoev.ru/en/
|
||||
*/
|
||||
|
||||
|
||||
@ -100,10 +100,6 @@ static int ngx_select_init(ngx_cycle_t *cycle)
|
||||
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;
|
||||
@ -122,8 +118,6 @@ static int ngx_select_init(ngx_cycle_t *cycle)
|
||||
|
||||
static void ngx_select_done(ngx_cycle_t *cycle)
|
||||
{
|
||||
ngx_event_timer_done(cycle);
|
||||
|
||||
ngx_free(event_index);
|
||||
ngx_free(ready_index);
|
||||
|
||||
@ -262,6 +256,7 @@ static int ngx_select_process_events(ngx_log_t *log)
|
||||
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)
|
||||
|
@ -120,10 +120,7 @@ static int ngx_event_init(ngx_cycle_t *cycle)
|
||||
#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);
|
||||
|
||||
|
@ -14,26 +14,13 @@ ngx_rbtree_t *ngx_event_timer_rbtree;
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
@ -19,12 +19,7 @@
|
||||
#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);
|
||||
|
||||
|
@ -921,18 +921,21 @@ void ngx_http_finalize_request(ngx_http_request_t *r, int rc)
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user