Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Avoid handling ping after close frame has been sent#394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
bhallionOhbibi wants to merge2 commits intocoder:devfrombhallionOhbibi:master
Closed
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
read.go: Avoid handling ping after close frame has been sent
Closes#298
  • Loading branch information
@bhallionOhbibi@nhooyr
bhallionOhbibi authored andnhooyr committedOct 19, 2023
commit69f55f34aacbc9979a6c4b88190f3d7e6b7fa968
7 changes: 7 additions & 0 deletionsread.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -286,6 +286,13 @@ func (c *Conn) handleControl(ctx context.Context, h header) (err error) {

switch h.opcode {
case opPing:
c.closeMu.Lock()
wroteClose := c.wroteClose
c.closeMu.Unlock()
if wroteClose {
// Cannot respond to ping with a pong because we already sent a close frame.
return nil
}
return c.writeControl(ctx, opPong, b)
case opPong:
c.activePingsMu.Lock()
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp