mirror of
https://github.com/nginx/nginx.git
synced 2025-06-16 00:21:02 +08:00
Removed "ch" argument from ngx_pass_open_channel().
This commit is contained in:
parent
3bbec30739
commit
02cca54770
@ -15,7 +15,7 @@ static void ngx_start_worker_processes(ngx_cycle_t *cycle, ngx_int_t n,
|
|||||||
ngx_int_t type);
|
ngx_int_t type);
|
||||||
static void ngx_start_cache_manager_processes(ngx_cycle_t *cycle,
|
static void ngx_start_cache_manager_processes(ngx_cycle_t *cycle,
|
||||||
ngx_uint_t respawn);
|
ngx_uint_t respawn);
|
||||||
static void ngx_pass_open_channel(ngx_cycle_t *cycle, ngx_channel_t *ch);
|
static void ngx_pass_open_channel(ngx_cycle_t *cycle);
|
||||||
static void ngx_signal_worker_processes(ngx_cycle_t *cycle, int signo);
|
static void ngx_signal_worker_processes(ngx_cycle_t *cycle, int signo);
|
||||||
static ngx_uint_t ngx_reap_children(ngx_cycle_t *cycle);
|
static ngx_uint_t ngx_reap_children(ngx_cycle_t *cycle);
|
||||||
static void ngx_master_process_exit(ngx_cycle_t *cycle);
|
static void ngx_master_process_exit(ngx_cycle_t *cycle);
|
||||||
@ -336,24 +336,15 @@ static void
|
|||||||
ngx_start_worker_processes(ngx_cycle_t *cycle, ngx_int_t n, ngx_int_t type)
|
ngx_start_worker_processes(ngx_cycle_t *cycle, ngx_int_t n, ngx_int_t type)
|
||||||
{
|
{
|
||||||
ngx_int_t i;
|
ngx_int_t i;
|
||||||
ngx_channel_t ch;
|
|
||||||
|
|
||||||
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "start worker processes");
|
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "start worker processes");
|
||||||
|
|
||||||
ngx_memzero(&ch, sizeof(ngx_channel_t));
|
|
||||||
|
|
||||||
ch.command = NGX_CMD_OPEN_CHANNEL;
|
|
||||||
|
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
|
|
||||||
ngx_spawn_process(cycle, ngx_worker_process_cycle,
|
ngx_spawn_process(cycle, ngx_worker_process_cycle,
|
||||||
(void *) (intptr_t) i, "worker process", type);
|
(void *) (intptr_t) i, "worker process", type);
|
||||||
|
|
||||||
ch.pid = ngx_processes[ngx_process_slot].pid;
|
ngx_pass_open_channel(cycle);
|
||||||
ch.slot = ngx_process_slot;
|
|
||||||
ch.fd = ngx_processes[ngx_process_slot].channel[0];
|
|
||||||
|
|
||||||
ngx_pass_open_channel(cycle, &ch);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,7 +354,6 @@ ngx_start_cache_manager_processes(ngx_cycle_t *cycle, ngx_uint_t respawn)
|
|||||||
{
|
{
|
||||||
ngx_uint_t i, manager, loader;
|
ngx_uint_t i, manager, loader;
|
||||||
ngx_path_t **path;
|
ngx_path_t **path;
|
||||||
ngx_channel_t ch;
|
|
||||||
|
|
||||||
manager = 0;
|
manager = 0;
|
||||||
loader = 0;
|
loader = 0;
|
||||||
@ -388,14 +378,7 @@ ngx_start_cache_manager_processes(ngx_cycle_t *cycle, ngx_uint_t respawn)
|
|||||||
&ngx_cache_manager_ctx, "cache manager process",
|
&ngx_cache_manager_ctx, "cache manager process",
|
||||||
respawn ? NGX_PROCESS_JUST_RESPAWN : NGX_PROCESS_RESPAWN);
|
respawn ? NGX_PROCESS_JUST_RESPAWN : NGX_PROCESS_RESPAWN);
|
||||||
|
|
||||||
ngx_memzero(&ch, sizeof(ngx_channel_t));
|
ngx_pass_open_channel(cycle);
|
||||||
|
|
||||||
ch.command = NGX_CMD_OPEN_CHANNEL;
|
|
||||||
ch.pid = ngx_processes[ngx_process_slot].pid;
|
|
||||||
ch.slot = ngx_process_slot;
|
|
||||||
ch.fd = ngx_processes[ngx_process_slot].channel[0];
|
|
||||||
|
|
||||||
ngx_pass_open_channel(cycle, &ch);
|
|
||||||
|
|
||||||
if (loader == 0) {
|
if (loader == 0) {
|
||||||
return;
|
return;
|
||||||
@ -405,19 +388,20 @@ ngx_start_cache_manager_processes(ngx_cycle_t *cycle, ngx_uint_t respawn)
|
|||||||
&ngx_cache_loader_ctx, "cache loader process",
|
&ngx_cache_loader_ctx, "cache loader process",
|
||||||
respawn ? NGX_PROCESS_JUST_SPAWN : NGX_PROCESS_NORESPAWN);
|
respawn ? NGX_PROCESS_JUST_SPAWN : NGX_PROCESS_NORESPAWN);
|
||||||
|
|
||||||
ch.command = NGX_CMD_OPEN_CHANNEL;
|
ngx_pass_open_channel(cycle);
|
||||||
ch.pid = ngx_processes[ngx_process_slot].pid;
|
|
||||||
ch.slot = ngx_process_slot;
|
|
||||||
ch.fd = ngx_processes[ngx_process_slot].channel[0];
|
|
||||||
|
|
||||||
ngx_pass_open_channel(cycle, &ch);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ngx_pass_open_channel(ngx_cycle_t *cycle, ngx_channel_t *ch)
|
ngx_pass_open_channel(ngx_cycle_t *cycle)
|
||||||
{
|
{
|
||||||
ngx_int_t i;
|
ngx_int_t i;
|
||||||
|
ngx_channel_t ch;
|
||||||
|
|
||||||
|
ch.command = NGX_CMD_OPEN_CHANNEL;
|
||||||
|
ch.pid = ngx_processes[ngx_process_slot].pid;
|
||||||
|
ch.slot = ngx_process_slot;
|
||||||
|
ch.fd = ngx_processes[ngx_process_slot].channel[0];
|
||||||
|
|
||||||
for (i = 0; i < ngx_last_process; i++) {
|
for (i = 0; i < ngx_last_process; i++) {
|
||||||
|
|
||||||
@ -430,14 +414,14 @@ ngx_pass_open_channel(ngx_cycle_t *cycle, ngx_channel_t *ch)
|
|||||||
|
|
||||||
ngx_log_debug6(NGX_LOG_DEBUG_CORE, cycle->log, 0,
|
ngx_log_debug6(NGX_LOG_DEBUG_CORE, cycle->log, 0,
|
||||||
"pass channel s:%i pid:%P fd:%d to s:%i pid:%P fd:%d",
|
"pass channel s:%i pid:%P fd:%d to s:%i pid:%P fd:%d",
|
||||||
ch->slot, ch->pid, ch->fd,
|
ch.slot, ch.pid, ch.fd,
|
||||||
i, ngx_processes[i].pid,
|
i, ngx_processes[i].pid,
|
||||||
ngx_processes[i].channel[0]);
|
ngx_processes[i].channel[0]);
|
||||||
|
|
||||||
/* TODO: NGX_AGAIN */
|
/* TODO: NGX_AGAIN */
|
||||||
|
|
||||||
ngx_write_channel(ngx_processes[i].channel[0],
|
ngx_write_channel(ngx_processes[i].channel[0],
|
||||||
ch, sizeof(ngx_channel_t), cycle->log);
|
&ch, sizeof(ngx_channel_t), cycle->log);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -621,12 +605,7 @@ ngx_reap_children(ngx_cycle_t *cycle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ch.command = NGX_CMD_OPEN_CHANNEL;
|
ngx_pass_open_channel(cycle);
|
||||||
ch.pid = ngx_processes[ngx_process_slot].pid;
|
|
||||||
ch.slot = ngx_process_slot;
|
|
||||||
ch.fd = ngx_processes[ngx_process_slot].channel[0];
|
|
||||||
|
|
||||||
ngx_pass_open_channel(cycle, &ch);
|
|
||||||
|
|
||||||
live = 1;
|
live = 1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user