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

Fix set_port to return correct boolean value #836

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

CarlosEduR
Copy link
Member

Fix: #826

@CarlosEduR CarlosEduR marked this pull request as draft January 10, 2025 01:48
@CarlosEduR
Copy link
Member Author

It looks like checking that in the set_port (before the parse_port) does not cause some tests to fail... Now I am wondering about the fuzzers.

@anonrig
Copy link
Member

anonrig commented Jan 10, 2025

It looks like checking that in the set_port (before the parse_port) does not cause some tests to fail... Now I am wondering about the fuzzers.

I think fuzzers are unrelated. It's failing on another PR.

@@ -791,6 +791,12 @@ bool url::set_port(const std::string_view input) {
return false;
}

uint16_t parsed_port{};
std::from_chars(trimmed.data(), trimmed.data() + trimmed.size(), parsed_port);
Copy link
Member

Choose a reason for hiding this comment

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

This is going to be slower. can we do it inside parse_port()

Copy link
Member Author

Choose a reason for hiding this comment

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

that was my initial attempt here e998da7, but these tests started failing:

6 - wpt_url_tests_typed.urltestdata_encoding<ada::url> (Failed)
9 - wpt_url_tests_typed.urltestdata_encoding<ada::url_aggregator> (Failed)
16 - url_components.urltestdata_encoding (Failed)

image

was my approach wrong?

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.

set_port returns true for invalid value
2 participants