uipc_socket2.c sbflush question

Andre Oppermann andre at freebsd.org
Thu Jan 15 08:13:34 PST 2004


In sys/kern/uipc_socket2.c:160 we have this:

void
soisdisconnected(so)
        register struct socket *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);
}

Why is sbdrop() called directly instead of sbflush()?  I think it makes
more sense to change that to a call to sbflush() which then DTRT?

-- 
Andre


More information about the freebsd-current mailing list