Commit Graph

7 Commits

Author SHA1 Message Date
Lasse R.H. Nielsen b2f0b8d083 Accept IPvFuture syntax in Uri.
The RFC 3986 grammar for `[...]` addresses accepts
IPv6 addresses  and IPvFuture addresses, where the latter
have the form `'v' <hexDigit>+ '.' (<unreserved>|<sub-delim>|':')+`.

This allows the IPvFuture syntax, with no interpretation,
as the `host` of a `Uri`.

For now, the `Uri(host: ...)` constructor argument only allows
IPvFuture addresses that are already wrapped in `[...]` brackets,
and the `Uri.host` gette returns IPvFuture addresses including
brackets.
The `Uri(host:...)` still allows unbracketed IPv6 addresses
(distinguished from plain host-names by containing a `:`),
and `Uri.host` returns IPv6 addresses without brackets.
`Uri.parse` only accept IPv6 and IPvFuture in brackets.
(Only IPv6 can have a zone.)

Fixes #60483.

CoreLibraryReviewExempt: Local implementation only, no API.
Bug: https://dartbug.com/60483
Change-Id: Id369ba1316b34f443edfe5b0f56864c32beddccc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421081
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2025-04-09 03:56:37 -07:00
Lasse R.H. Nielsen 17592a58e3 Change internal character set representation in Uri.
Avoid doing computed shifts and parameterizing with
tables, so that all lookups can be with a fixed
base and only do one bit-operation.

Tested: Refactoring, covered by existing tests.
Change-Id: I8c4ffdb0eaef6c26de996ca40d1d697c1ba23bb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392943
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-12-10 13:57:33 +00:00
Lasse R.H. Nielsen fcd4d86bbe Reland "Avoid computing the URI scanner tables at runtime."
This is a reland of commit 5875a9ba9d

Original change's description:
> Avoid computing the URI scanner tables at runtime.
>
> Precompute the table and store it as a String literal.
>
> Fixes #49108.
>
> Bug: https://dartbug.com/49108
> Change-Id: I33d3e768ad2013ad2edec3558fcd3da39b3f4f32
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247383
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Auto-Submit: Lasse Nielsen <lrn@google.com>

Bug: https://dartbug.com/49108
Change-Id: Ia2c19457a10708b03817e8da4bd6d9dec35c012a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247961
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2024-12-04 22:40:03 +00:00
Ilya Yanok d3f30dc3c6 Revert "Reapply "Avoid computing the URI scanner tables at runtime.""
This reverts commit 4c7110332e.

Reason for revert: Still breaks the same tests, see b/242715525

Original change's description:
> Reapply "Avoid computing the URI scanner tables at runtime."
>
> This reverts commit 855e1cd975.
>
> The blocking issue in internal test code is assumed fixed.
>
> Change-Id: I74e0be130d149a45f77dc90c354916308b76b741
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255248
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Auto-Submit: Lasse Nielsen <lrn@google.com>

TBR=lrn@google.com,kustermann@google.com

Change-Id: I391d2eb6dd9ae7367f656eaaaa7f9aeb1c31e0f7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255254
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ilya Yanok <yanok@google.com>
Reviewed-by: Ilya Yanok <yanok@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-08-16 16:46:28 +00:00
Lasse R.H. Nielsen 4c7110332e Reapply "Avoid computing the URI scanner tables at runtime."
This reverts commit 855e1cd975.

The blocking issue in internal test code is assumed fixed.

Change-Id: I74e0be130d149a45f77dc90c354916308b76b741
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255248
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Lasse Nielsen <lrn@google.com>
2022-08-16 14:53:07 +00:00
Siva Annamalai 855e1cd975 Revert "Avoid computing the URI scanner tables at runtime."
This reverts commit 5875a9ba9d.

Reason for revert: We seem to have some cbuild failures, logs can be found here https://dart-in-g3-qa-prod.corp.google.com/dg3/Home#/cbuild/find/5875a9ba9d7f84aec616ab89b4c29bae06d1587c

Original change's description:
> Avoid computing the URI scanner tables at runtime.
>
> Precompute the table and store it as a String literal.
>
> Fixes #49108.
>
> Bug: https://dartbug.com/49108
> Change-Id: I33d3e768ad2013ad2edec3558fcd3da39b3f4f32
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247383
> Reviewed-by: Slava Egorov <vegorov@google.com>
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Auto-Submit: Lasse Nielsen <lrn@google.com>

TBR=lrn@google.com,vegorov@google.com,kustermann@google.com

Change-Id: I3c2609aad7944ea9118af14733c3e99db9902297
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://dartbug.com/49108
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247860
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2022-06-09 20:28:53 +00:00
Lasse R.H. Nielsen 5875a9ba9d Avoid computing the URI scanner tables at runtime.
Precompute the table and store it as a String literal.

Fixes #49108.

Bug: https://dartbug.com/49108
Change-Id: I33d3e768ad2013ad2edec3558fcd3da39b3f4f32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247383
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Auto-Submit: Lasse Nielsen <lrn@google.com>
2022-06-09 15:30:33 +00:00