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

Register default port for common internet schema #2622

Merged
merged 1 commit into from
Nov 5, 2021
Merged

Register default port for common internet schema #2622

merged 1 commit into from
Nov 5, 2021

Conversation

mkykadir
Copy link
Contributor

@mkykadir mkykadir commented Oct 14, 2021

Separates default port from URL and ties default port to common internet schema. Default behavior of URL.defaultPort is kept (returns 0 for unknown schemas). Built-in schemas are registered at init.

Changes

  • StringSet renamed and converted to ushort[string] map
  • Built-in schemas are registered as common internet schemas
  • New function implemented for getting default port of a registered common internet schema

Decision points before merge

  • registerCommonInternetSchema can throw exception when schema is already registered within built-in schemas (or user schemas, user schemas can be updated silently) -> Schemas will be updated silently
  • getDefaultPortOfCommonInternetSchema can be nothrow (thus @nogc) and return 0 directly

inet/vibe/inet/url.d Outdated Show resolved Hide resolved
inet/vibe/inet/url.d Outdated Show resolved Hide resolved
inet/vibe/inet/url.d Outdated Show resolved Hide resolved
inet/vibe/inet/url.d Outdated Show resolved Hide resolved
inet/vibe/inet/url.d Outdated Show resolved Hide resolved
inet/vibe/inet/url.d Outdated Show resolved Hide resolved
inet/vibe/inet/url.d Outdated Show resolved Hide resolved
inet/vibe/inet/url.d Outdated Show resolved Hide resolved
@Geod24 Geod24 merged commit ad93554 into vibe-d:master Nov 5, 2021
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