mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-24 23:25:58 +00:00
lwip_recvmsg: MSG_PEEK must be limited to the first iov for TCP
This commit is contained in:
parent
15918d8971
commit
cb1a271c61
@ -1144,8 +1144,9 @@ lwip_recvmsg(int s, struct msghdr *message, int flags)
|
|||||||
/* sum up received bytes */
|
/* sum up received bytes */
|
||||||
ret += recvd_local;
|
ret += recvd_local;
|
||||||
}
|
}
|
||||||
if ((recvd_local < 0) || (recvd_local < (int)message->msg_iov[i].iov_len)) {
|
if ((recvd_local < 0) || (recvd_local < (int)message->msg_iov[i].iov_len) ||
|
||||||
/* returned prematurely */
|
(flags & MSG_PEEK)) {
|
||||||
|
/* returned prematurely (or peeking, which might actually be limitated to the first iov) */
|
||||||
if (ret <= 0) {
|
if (ret <= 0) {
|
||||||
/* nothing received at all, propagate the error */
|
/* nothing received at all, propagate the error */
|
||||||
ret = recvd_local;
|
ret = recvd_local;
|
||||||
|
Loading…
Reference in New Issue
Block a user