diff --git a/src/api/sockets.c b/src/api/sockets.c index 1e7e6bae..6cfd27b3 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -994,6 +994,10 @@ lwip_sendmsg(int s, const struct msghdr *msg, int flags) ((flags & MSG_DONTWAIT) ? NETCONN_DONTBLOCK : 0); for (i = 0; i < msg->msg_iovlen; i++) { + u8_t apiflags = write_flags; + if (i + 1 < msg->msg_iovlen) { + apiflags |= NETCONN_MORE; + } written = 0; err = netconn_write_partly(sock->conn, msg->msg_iov[i].iov_base, msg->msg_iov[i].iov_len, write_flags, &written); if (err == ERR_OK) {