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

Handle large payloads on 32bit platforms gracefully #29

Merged
merged 1 commit into from Nov 28, 2023

Conversation

czechboy0
Copy link
Collaborator

Motivation

If there's a request payload with a number of bytes that can't fit into 32 bits, we'd crash.

Modifications

Use a graceful initializer and use .unknown (so no content-length will be sent) if the size exceeds the max of a 32bit int.

Result

No crash for large payloads on 32bit platforms.

Test Plan

Tests pass.

Copy link
Collaborator

@dnadoba dnadoba left a comment

Choose a reason for hiding this comment

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

Thanks!

@czechboy0 czechboy0 merged commit 0859ead into swift-server:main Nov 28, 2023
4 checks passed
@czechboy0 czechboy0 deleted the hd-int-on-32bit branch November 28, 2023 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants