Skip to content

Commit

Permalink
Tolerate 0-length iovecs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Lopatic authored and gooding470 committed Jun 8, 2018
1 parent 4f7e0bc commit 8f88723
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cf/src/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,11 @@ cf_socket_send_msg(cf_socket *sock, struct msghdr *m, int32_t flags)
struct iovec *v = m->msg_iov;

for (socklen_t i = 0; i < m->msg_iovlen; i++) {
int rv = tls_socket_send(sock, v->iov_base, v->iov_len, flags, 0);
int rv = 0;

if (v->iov_len > 0) {
rv = tls_socket_send(sock, v->iov_base, v->iov_len, flags, 0);
}

if (rv < 0) {
// errno is set by tls_socket_send.
Expand Down

0 comments on commit 8f88723

Please sign in to comment.