Skip to content

[RequestBag] Fix consumption error in state machine #441

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

Merged

Conversation

fabianfett
Copy link
Member

Motivation

If a RequestBag was consuming received http body parts in its HTTPClientResponseDelegate in the didReceiveBodyPart and received a succeedRequest, the didFinishRequest was called before the didReceiveBodyPart future was resolved.

Changes

  • Call didFinishRequest only once the didReceiveBodyPart future was succeeded.

Result

@fabianfett
Copy link
Member Author

swift-nightly fails because of Sendable requirements.

@fabianfett fabianfett merged commit 316cbf9 into swift-server:main Sep 27, 2021
@fabianfett fabianfett deleted the ff-fix-race-condition-on-close branch September 27, 2021 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants