Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conn.go: default close handler should not return ErrCloseSent. #865

Merged
merged 2 commits into from
Nov 13, 2023

Conversation

pnx
Copy link
Contributor

@pnx pnx commented Nov 9, 2023

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Go Version Update
  • Dependency Update

Description

Noticed a change in default close handler from 1.5.0 to 1.5.1

1.5.1 Now returns the error from WriteControl with CloseMessage type. However this results in ErrCloseSent returned if the connection initiated the close handshake. This is normally correct as the connection should not be able to write after a close handshake is initiated, except when calling the close handler. in that case nil should be returned so that advanceFrame() can return the actual close message.

Related Tickets & Documents

Added/updated tests?

  • Yes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

Run verifications and test

  • make verify is passing (fails with GO-2023-2186 Incorrect detection of reserved device names on Windows in path/filepath that is unrelated to this change)
  • make test is passing

@pnx
Copy link
Contributor Author

pnx commented Nov 12, 2023

@coreydaley can you take a look at this?

Copy link

codecov bot commented Nov 13, 2023

Codecov Report

Merging #865 (07089bb) into main (629990d) will increase coverage by 0.20%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##             main     #865      +/-   ##
==========================================
+ Coverage   69.99%   70.20%   +0.20%     
==========================================
  Files          11       11              
  Lines        1593     1594       +1     
==========================================
+ Hits         1115     1119       +4     
+ Misses        364      362       -2     
+ Partials      114      113       -1     
Files Coverage Δ
conn.go 65.47% <50.00%> (+0.46%) ⬆️

@coreydaley coreydaley self-requested a review November 13, 2023 00:46
@coreydaley coreydaley merged commit 6f5d213 into gorilla:main Nov 13, 2023
10 of 13 checks passed
@ghost ghost mentioned this pull request Dec 11, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants