Skip to content

Conversation

@fabianfett
Copy link
Member

Motivation

In the HTTP1ConnectionStateMachine we set the connection state to .closed after having forwarded an error to the inner RequestStateMachine. Since we set the error to close, the state.modify function did not create an action that would close the connection.

Changes

  • Modify the ConnectionState based on the RequestStateMachine only in the state.modify function.
  • Add a test to verify the fixed behavior.
  • Use ExpressibleByDictionaryLiteral syntax for some HTTPHeaders to increase readability.

Result

Connections are closed, if an error happens, while we are in a request.

@fabianfettfabianfett added the 🔨 semver/patch No public API change. label Sep 13, 2021
@fabianfettfabianfett added this to the HTTP/2 support milestone Sep 13, 2021
Copy link
Collaborator

@LukasaLukasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch

@fabianfettfabianfett merged commit 324adb7 into swift-server:mainSep 14, 2021
@fabianfettfabianfett deleted the ff-close-on-error-while-in-request branch September 14, 2021 08:27
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patchNo public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@fabianfett@Lukasa