mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 19:52:44 +00:00
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.
This commit is contained in:
parent
6576952ca5
commit
25dec7474c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=100775
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user