mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-26 03:16:18 +00:00
Enable support for MSG_DONTWAIT in lwip_recvmsg()
Enables support for MSG_DONTWAIT in lwip_recvmsg(). Support already exists in lwip_recv_tcp() and lwip_recvfrom_udp_raw(); these are both accessible from lwip_recvfrom(), which already supports MSG_DONTWAIT. Signed-off-by: Nate Karstens <nate.karstens@garmin.com> Signed-off-by: Joel Cunningham <joel.cunningham@me.com>
This commit is contained in:
parent
f41b5b84b1
commit
1960937df3
@ -1212,7 +1212,7 @@ lwip_recvmsg(int s, struct msghdr *message, int flags)
|
|||||||
|
|
||||||
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvmsg(%d, message=%p, flags=0x%x)\n", s, (void *)message, flags));
|
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvmsg(%d, message=%p, flags=0x%x)\n", s, (void *)message, flags));
|
||||||
LWIP_ERROR("lwip_recvmsg: invalid message pointer", message != NULL, return ERR_ARG;);
|
LWIP_ERROR("lwip_recvmsg: invalid message pointer", message != NULL, return ERR_ARG;);
|
||||||
LWIP_ERROR("lwip_recvmsg: unsupported flags", ((flags == 0) || (flags == MSG_PEEK)),
|
LWIP_ERROR("lwip_recvmsg: unsupported flags", (flags & ~(MSG_PEEK|MSG_DONTWAIT)) == 0,
|
||||||
set_errno(EOPNOTSUPP); return -1;);
|
set_errno(EOPNOTSUPP); return -1;);
|
||||||
|
|
||||||
if ((message->msg_iovlen <= 0) || (message->msg_iovlen > IOV_MAX)) {
|
if ((message->msg_iovlen <= 0) || (message->msg_iovlen > IOV_MAX)) {
|
||||||
@ -1260,8 +1260,7 @@ lwip_recvmsg(int s, struct msghdr *message, int flags)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* while MSG_DONTWAIT is not supported for this function, we pass it to
|
/* pass MSG_DONTWAIT to lwip_recv_tcp() to prevent waiting for more data */
|
||||||
lwip_recv_tcp() to prevent waiting for more data */
|
|
||||||
recv_flags |= MSG_DONTWAIT;
|
recv_flags |= MSG_DONTWAIT;
|
||||||
}
|
}
|
||||||
if (buflen > 0) {
|
if (buflen > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user