diff options
author | jlemon <jlemon@FreeBSD.org> | 2001-03-16 22:37:06 +0000 |
---|---|---|
committer | jlemon <jlemon@FreeBSD.org> | 2001-03-16 22:37:06 +0000 |
commit | c8d2423b8b8572976703bb9d08c008c0aab1850e (patch) | |
tree | fff3635fe3a69314b1da0bbb6bb0df37e7aa09f3 /sys/kern | |
parent | 8d74e08df53b4e20f79a31d6950d4faf882e0983 (diff) | |
download | FreeBSD-src-c8d2423b8b8572976703bb9d08c008c0aab1850e.zip FreeBSD-src-c8d2423b8b8572976703bb9d08c008c0aab1850e.tar.gz |
When doing a recv(.. MSG_WAITALL) for a message which is larger than
the socket buffer size, the receive is done in sections. After completing
a read, call pru_rcvd on the underlying protocol before blocking again.
This allows the the protocol to take appropriate action, such as
sending a TCP window update to the peer, if the window happened to
close because the socket buffer was filled. If the protocol is not
notified, a TCP transfer may stall until the remote end sends a window
probe.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/uipc_socket.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index ef4ac59..0051121 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -910,6 +910,12 @@ dontblock: !sosendallatonce(so) && !nextrecord) { if (so->so_error || so->so_state & SS_CANTRCVMORE) break; + /* + * Notify the protocol that some data has been + * drained before blocking. + */ + if (pr->pr_flags & PR_WANTRCVD && so->so_pcb) + (*pr->pr_usrreqs->pru_rcvd)(so, flags); error = sbwait(&so->so_rcv); if (error) { sbunlock(&so->so_rcv); |