Fix crash causing deadlock in connection writer when no messages have been posted yet
This commit is contained in:
parent
364f617ade
commit
874bba43f8
@ -408,7 +408,7 @@ func (cn *connection) writer(keepAliveTimeout time.Duration) {
|
||||
keepAliveTimer := time.NewTimer(keepAliveTimeout)
|
||||
for {
|
||||
cn.mu().Lock()
|
||||
for cn.outgoingUnbufferedMessages.Len() != 0 {
|
||||
for cn.outgoingUnbufferedMessages != nil && cn.outgoingUnbufferedMessages.Len() != 0 {
|
||||
msg := cn.outgoingUnbufferedMessages.Remove(cn.outgoingUnbufferedMessages.Front()).(pp.Message)
|
||||
cn.mu().Unlock()
|
||||
b, err := msg.MarshalBinary()
|
||||
|
Loading…
x
Reference in New Issue
Block a user