Skip to content

fix!: Represent TCP port as UInt16 #924

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
merged 1 commit into from
Apr 22, 2025
Merged

fix!: Represent TCP port as UInt16 #924

merged 1 commit into from
Apr 22, 2025

Conversation

jbelkins
Copy link
Contributor

@jbelkins jbelkins commented Apr 22, 2025

Description of changes

[BREAKING] Changes the type for port number from Int16 to UInt16. TCP port may be from 0-65535 which is beyond the range of Int16.

This affects public interfaces for URI, Endpoint, HTTPRequest, and their associated builder types.

The change is breaking because port number is exposed as a property of several public types and parameters to public functions. The change is being made nonetheless because it is a significant impediment to not allow use of all possible TCP ports.

Scope

  • Breaking bug fix (breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jbelkins jbelkins requested review from dayaffe and sichanyoo April 22, 2025 16:49
@jbelkins jbelkins marked this pull request as ready for review April 22, 2025 16:49
Copy link
Contributor

@dayaffe dayaffe left a comment

Choose a reason for hiding this comment

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

Same comment as companion PR. I think port should be Int until the exact place it needs to be converted. At which point we could use something like https://developer.apple.com/documentation/kernel/in_port_t to ensure it is a valid port.

@jbelkins jbelkins merged commit e551fd6 into main Apr 22, 2025
31 checks passed
@jbelkins jbelkins deleted the jbe/tcp_port_fix branch April 22, 2025 17:24
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.

3 participants