Always socantsendmore() before deallocating a socket. This, in turn,

calls selwakeup() if necessary (which it is, if you don't want freed
memory hanging around on your td->td_selq).

Props to:	alfred
This commit is contained in:
green 2004-02-12 01:48:40 +00:00
parent 5861d141d6
commit c270474e0b

View File

@ -291,6 +291,7 @@ sofree(so)
struct socket *so;
{
struct socket *head = so->so_head;
int s;
KASSERT(so->so_count == 0, ("socket %p so_count not 0", so));
@ -314,6 +315,12 @@ sofree(so)
so->so_state &= ~SS_INCOMP;
so->so_head = NULL;
}
so->so_snd.sb_flags |= SB_NOINTR;
(void)sblock(&so->so_snd, M_WAITOK);
s = splimp();
socantsendmore(so);
splx(s);
sbunlock(&so->so_snd);
sbrelease(&so->so_snd, so);
sorflush(so);
sodealloc(so);