another last guard against sending on closed channel.
This commit is contained in:
@@ -474,6 +474,10 @@ func (r *Relay) WriteWithError(msg []byte) error {
|
|||||||
|
|
||||||
defer r.closeMutex.Unlock()
|
defer r.closeMutex.Unlock()
|
||||||
|
|
||||||
|
if r.writeQueue != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case <-r.connectionContext.Done():
|
case <-r.connectionContext.Done():
|
||||||
return fmt.Errorf("failed to write to %s: %w", r.URL, context.Cause(r.connectionContext))
|
return fmt.Errorf("failed to write to %s: %w", r.URL, context.Cause(r.connectionContext))
|
||||||
|
|||||||
Reference in New Issue
Block a user