diff options
Diffstat (limited to 'src/os/unix/ngx_channel.c')
-rw-r--r-- | src/os/unix/ngx_channel.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/os/unix/ngx_channel.c b/src/os/unix/ngx_channel.c index 3d09d68bb..5c5a5e10b 100644 --- a/src/os/unix/ngx_channel.c +++ b/src/os/unix/ngx_channel.c @@ -120,9 +120,14 @@ ngx_int_t ngx_read_channel(ngx_socket_t s, ngx_channel_t *ch, size_t size, return NGX_ERROR; } + if (n == 0) { + ngx_log_debug0(NGX_LOG_DEBUG_CORE, log, 0, "recvmsg() returned zero"); + return NGX_ERROR; + } + if ((size_t) n < sizeof(ngx_channel_t)) { ngx_log_error(NGX_LOG_ALERT, log, 0, - "recvmsg() returned not enough data"); + "recvmsg() returned not enough data: %uz", n); return NGX_ERROR; } |