Don't access sockbuf fields directly, use accessor functions instead.
It is safe to move the call to socantsendmore_locked() after sbdrop_locked() as long as we hold the sockbuf lock across the two calls. CR: D1805 Reviewed by: adrian, kmacy, julian, rwatson
This commit is contained in:
parent
bacc28cea1
commit
a76d4388e1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=278780
@ -3439,11 +3439,9 @@ soisdisconnecting(struct socket *so)
|
||||
SOCKBUF_LOCK(&so->so_rcv);
|
||||
so->so_state &= ~SS_ISCONNECTING;
|
||||
so->so_state |= SS_ISDISCONNECTING;
|
||||
so->so_rcv.sb_state |= SBS_CANTRCVMORE;
|
||||
sorwakeup_locked(so);
|
||||
socantrcvmore_locked(so);
|
||||
SOCKBUF_LOCK(&so->so_snd);
|
||||
so->so_snd.sb_state |= SBS_CANTSENDMORE;
|
||||
sowwakeup_locked(so);
|
||||
socantsendmore_locked(so);
|
||||
wakeup(&so->so_timeo);
|
||||
}
|
||||
|
||||
@ -3458,12 +3456,10 @@ soisdisconnected(struct socket *so)
|
||||
SOCKBUF_LOCK(&so->so_rcv);
|
||||
so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING);
|
||||
so->so_state |= SS_ISDISCONNECTED;
|
||||
so->so_rcv.sb_state |= SBS_CANTRCVMORE;
|
||||
sorwakeup_locked(so);
|
||||
socantrcvmore_locked(so);
|
||||
SOCKBUF_LOCK(&so->so_snd);
|
||||
so->so_snd.sb_state |= SBS_CANTSENDMORE;
|
||||
sbdrop_locked(&so->so_snd, sbused(&so->so_snd));
|
||||
sowwakeup_locked(so);
|
||||
socantsendmore_locked(so);
|
||||
wakeup(&so->so_timeo);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user