diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2002-07-27 23:06:52 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2002-07-27 23:06:52 +0000 |
commit | ef1d91be310b939a2d6249ca83f9fee3dd67344a (patch) | |
tree | 04074352c2ecc070333b16761fb7709a1bba9744 /sys/kern/uipc_socket2.c | |
parent | 3b0d121aebc77955e4421574c410eec83ce4d604 (diff) | |
download | FreeBSD-src-ef1d91be310b939a2d6249ca83f9fee3dd67344a.zip FreeBSD-src-ef1d91be310b939a2d6249ca83f9fee3dd67344a.tar.gz |
If a socket is disconnected for some reason (like a TCP connection
not responding) then drop any data on the outgoing queue in
soisdisconnected because there is no way to get it to its destination
any longer.
The only objection to this patch I got on -net was from Terry, who
wasn't sure that the condition in question could arise, so I provided
some example code.
Diffstat (limited to 'sys/kern/uipc_socket2.c')
-rw-r--r-- | sys/kern/uipc_socket2.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index f917cdb..8b36396 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -158,6 +158,7 @@ soisdisconnected(so) so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING); so->so_state |= (SS_CANTRCVMORE|SS_CANTSENDMORE|SS_ISDISCONNECTED); wakeup(&so->so_timeo); + sbdrop(&so->so_snd, so->so_snd.sb_cc); sowwakeup(so); sorwakeup(so); } |