read channel until EAGAIN

This commit is contained in:
Igor Sysoev 2008-05-25 18:27:38 +00:00
parent 875f90f6d2
commit 889d7a8301

View file

@ -1054,6 +1054,8 @@ ngx_channel_handler(ngx_event_t *ev)
ngx_log_debug0(NGX_LOG_DEBUG_CORE, ev->log, 0, "channel handler"); ngx_log_debug0(NGX_LOG_DEBUG_CORE, ev->log, 0, "channel handler");
for ( ;; ) {
n = ngx_read_channel(c->fd, &ch, sizeof(ngx_channel_t), ev->log); n = ngx_read_channel(c->fd, &ch, sizeof(ngx_channel_t), ev->log);
ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, "channel: %i", n); ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, "channel: %i", n);
@ -1098,7 +1100,8 @@ ngx_channel_handler(ngx_event_t *ev)
case NGX_CMD_OPEN_CHANNEL: case NGX_CMD_OPEN_CHANNEL:
ngx_log_debug3(NGX_LOG_DEBUG_CORE, ev->log, 0, ngx_log_debug3(NGX_LOG_DEBUG_CORE, ev->log, 0,
"get channel s:%i pid:%P fd:%d", ch.slot, ch.pid, ch.fd); "get channel s:%i pid:%P fd:%d",
ch.slot, ch.pid, ch.fd);
ngx_processes[ch.slot].pid = ch.pid; ngx_processes[ch.slot].pid = ch.pid;
ngx_processes[ch.slot].channel[0] = ch.fd; ngx_processes[ch.slot].channel[0] = ch.fd;
@ -1119,6 +1122,7 @@ ngx_channel_handler(ngx_event_t *ev)
ngx_processes[ch.slot].channel[0] = -1; ngx_processes[ch.slot].channel[0] = -1;
break; break;
} }
}
} }