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
3b0d121aeb
commit
ef1d91be31
@ -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…
x
Reference in New Issue
Block a user