aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_udp_sendmsg_chain.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/unix/ngx_udp_sendmsg_chain.c')
-rw-r--r--src/os/unix/ngx_udp_sendmsg_chain.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/os/unix/ngx_udp_sendmsg_chain.c b/src/os/unix/ngx_udp_sendmsg_chain.c
index 5399c7916..3d1d6dde4 100644
--- a/src/os/unix/ngx_udp_sendmsg_chain.c
+++ b/src/os/unix/ngx_udp_sendmsg_chain.c
@@ -189,6 +189,13 @@ ngx_udp_output_chain_to_iovec(ngx_iovec_t *vec, ngx_chain_t *in, ngx_log_t *log)
return cl;
}
+ /* zero-sized datagram; pretend to have at least 1 iov */
+ if (n == 0) {
+ iov = &vec->iovs[n++];
+ iov->iov_base = NULL;
+ iov->iov_len = 0;
+ }
+
vec->count = n;
vec->size = total;