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
@ -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