Skip to content

Commit

Permalink
write.go: Fix potential writeFrame deadlock
Browse files Browse the repository at this point in the history
Closes #405

You should always be reading from the connection with CloseRead so this shouldn't
have affected anyone using the library correctly.
  • Loading branch information
nhooyr committed Oct 19, 2023
1 parent 6cec2ca commit 5fe95bb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions write.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ func (c *Conn) writeFrame(ctx context.Context, fin bool, flate bool, opcode opco
err = errClosed
case <-ctx.Done():
err = ctx.Err()
default:
}
c.close(err)
err = fmt.Errorf("failed to write frame: %w", err)
Expand Down

0 comments on commit 5fe95bb

Please sign in to comment.