Skip to content

send the CONNECTION_REFUSED error when refusing a connection#4250

Merged
marten-seemann merged 1 commit intomasterfrom
actually-send-connection-refused
Jan 19, 2024
Merged

send the CONNECTION_REFUSED error when refusing a connection#4250
marten-seemann merged 1 commit intomasterfrom
actually-send-connection-refused

Conversation

@marten-seemann
Copy link
Copy Markdown
Member

@marten-seemann marten-seemann commented Jan 19, 2024

So far, we used Connection.destroy, which destroys a connection without sending out a CONNECTION_CLOSE frame. This is useful (for example) when receiving a stateless reset, but it's not what we want when the server refuses an incoming connection. In this case, we want to send out a packet with a CONNECTION_CLOSE frame to inform the client that the connection attempt is being rejected.

This PR also adds an integration test. Once again this confirms the rule: If there's no test, it will break, rather sooner than later.

@marten-seemann marten-seemann added this to the v0.42 milestone Jan 19, 2024
So far, we used Connection.destroy, which destroys a connection without
sending out a CONNECTION_CLOSE frame. This is useful (for example) when
receiving a stateless reset, but it's not what we want when the server
refuses an incoming connection. In this case, we want to send out a
packet with a CONNECTION_CLOSE frame to inform the client that the
connection attempt is being rejected.
@marten-seemann marten-seemann force-pushed the actually-send-connection-refused branch from 00933a8 to 2531ac6 Compare January 19, 2024 06:16
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 19, 2024

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (b3eb375) 84.11% compared to head (2531ac6) 84.10%.

Files Patch % Lines
closed_conn.go 28.57% 5 Missing ⚠️
connection.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4250      +/-   ##
==========================================
- Coverage   84.11%   84.10%   -0.01%     
==========================================
  Files         150      150              
  Lines       15398    15403       +5     
==========================================
+ Hits        12951    12954       +3     
- Misses       1946     1948       +2     
  Partials      501      501              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@marten-seemann marten-seemann linked an issue Jan 19, 2024 that may be closed by this pull request
@marten-seemann marten-seemann changed the title send out the CONNECTION_REFUSED error when refusing a connection send the CONNECTION_REFUSED error when refusing a connection Jan 19, 2024
@marten-seemann marten-seemann merged commit cb1775a into master Jan 19, 2024
@marten-seemann marten-seemann deleted the actually-send-connection-refused branch January 19, 2024 06:30
nanokatze pushed a commit to nanokatze/quic-go that referenced this pull request Feb 1, 2024
…c-go#4250)

So far, we used Connection.destroy, which destroys a connection without
sending out a CONNECTION_CLOSE frame. This is useful (for example) when
receiving a stateless reset, but it's not what we want when the server
refuses an incoming connection. In this case, we want to send out a
packet with a CONNECTION_CLOSE frame to inform the client that the
connection attempt is being rejected.
mgjeong pushed a commit to mgjeong/quic-go that referenced this pull request Feb 13, 2024
…c-go#4250)

So far, we used Connection.destroy, which destroys a connection without
sending out a CONNECTION_CLOSE frame. This is useful (for example) when
receiving a stateless reset, but it's not what we want when the server
refuses an incoming connection. In this case, we want to send out a
packet with a CONNECTION_CLOSE frame to inform the client that the
connection attempt is being rejected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CONNECTION_REFUSED errors are not sent out from the server

1 participant