Zichang Guo
b65c90a07a
[dart:io] Fix _connecting counting in HttpClient
...
Resolves comments in previous cl and fix a problem where _connecting
decrements twice.
Bug: https://github.com/dart-lang/sdk/issues/34477
Change-Id: Icf5a98f4cf9e3f6ca582fe69f41074d482e00f0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148841
Commit-Queue: Zichang Guo <zichangguo@google.com >
Reviewed-by: Jonas Termansen <sortie@google.com >
2020-06-15 22:24:02 +00:00
Leaf Petersen
d2543e32f4
Migrate standalone tests which rely on the pre-nnbd sdk libraries.
...
Migrate all the tests under standalone/ that include files under
sdk/sdk/ as part files to unblock the replacement of the unmigrated
sdk/sdk with the contents of the migrated sdk/sdk_nnbd.
Change-Id: Ia2e78bbff797f58244d94021d4b9616793bd641d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151036
Commit-Queue: Leaf Petersen <leafp@google.com >
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com >
Reviewed-by: Jonas Termansen <sortie@google.com >
2020-06-15 19:41:46 +00:00
Zichang Guo
a3eacf734e
Revert "File::Copy avoids direct copying on Windows"
...
This reverts commit 391d3bcdd8 .
Reason for revert: https://github.com/dart-lang/sdk/issues/42291
Original change's description:
> File::Copy avoids direct copying on Windows
>
> There is a race condition for copying file on Windows, where CopyFile()
> returns success but data has not been populated into destination file.
> E.g process is killed or died in the middle.
>
> This cl will change File::Copy as
> 1. Copy file to a temp file in the same directory of destination file.
> 2. Rename the file to the target file.
>
> Bug: https://github.com/dart-lang/sdk/issues/42119
> Change-Id: I39b6d451f6ace970bc554501148259d33de232c7
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149667
> Commit-Queue: Zichang Guo <zichangguo@google.com >
> Reviewed-by: Zach Anderson <zra@google.com >
TBR=zra@google.com ,asiva@google.com ,zichangguo@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: https://github.com/dart-lang/sdk/issues/42119
Change-Id: I816611107498f41ab4af7c065ac2162af585ae95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151028
Reviewed-by: Zichang Guo <zichangguo@google.com >
Commit-Queue: Zichang Guo <zichangguo@google.com >
2020-06-12 06:27:48 +00:00
Zichang Guo
ae789e2cf8
Reland "[dart:io] Fixes the FileIO performance regression"
...
This is a reland of ba25fd190e
Original change's description:
> [dart:io] Fixes the FileIO performance regression
>
> Previous CL (https://dart-review.googlesource.com/c/sdk/+/139881 ) causes
> performance regression.
>
> Improves:
> FileIO_readwrite_512kb: 196.5%, 224.1%
> FileIO_readwrite_verify_512kb: 38.28% 46.71%
>
>
> Change-Id: I5fb7752f14a2b39238e82bf45b059fe145b9087f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148563
> Commit-Queue: Zichang Guo <zichangguo@google.com >
> Reviewed-by: Martin Kustermann <kustermann@google.com >
> Reviewed-by: Jonas Termansen <sortie@google.com >
Change-Id: I86d4919716ac3a333000482e4a96532fe4e7d543
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149882
Commit-Queue: Zichang Guo <zichangguo@google.com >
Reviewed-by: Martin Kustermann <kustermann@google.com >
2020-06-09 05:31:44 +00:00
Zichang Guo
391d3bcdd8
File::Copy avoids direct copying on Windows
...
There is a race condition for copying file on Windows, where CopyFile()
returns success but data has not been populated into destination file.
E.g process is killed or died in the middle.
This cl will change File::Copy as
1. Copy file to a temp file in the same directory of destination file.
2. Rename the file to the target file.
Bug: https://github.com/dart-lang/sdk/issues/42119
Change-Id: I39b6d451f6ace970bc554501148259d33de232c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149667
Commit-Queue: Zichang Guo <zichangguo@google.com >
Reviewed-by: Zach Anderson <zra@google.com >
2020-06-09 00:03:05 +00:00
Zichang Guo
7112027a9d
Unlink file before Unix socket binds
...
Previously, an unix domain socket will be cleaned up within Socket's
finalizer. But if processes are killed, the file(socket) will remain and
prevent following bind().
Throw an exception when the file exists and no
active sockets has the same path.
Closes https://github.com/dart-lang/sdk/issues/42103
Change-Id: Ieb04b9e1b197064531ab6361c027b374c3d44411
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149081
Commit-Queue: Zichang Guo <zichangguo@google.com >
Reviewed-by: Siva Annamalai <asiva@google.com >
2020-06-03 22:10:40 +00:00
Zichang Guo
4489805956
Revert "[dart:io] Fixes the FileIO performance regression"
...
This reverts commit ba25fd190e .
Reason for revert: It broke dart2js. https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8878578963299042720/+/steps/build_dart/0/stdout?format=raw .
Unimplemented handling of missing static target.
Original change's description:
> [dart:io] Fixes the FileIO performance regression
>
> Previous CL (https://dart-review.googlesource.com/c/sdk/+/139881 ) causes
> performance regression.
>
> Improves:
> FileIO_readwrite_512kb: 196.5%, 224.1%
> FileIO_readwrite_verify_512kb: 38.28% 46.71%
>
>
> Change-Id: I5fb7752f14a2b39238e82bf45b059fe145b9087f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148563
> Commit-Queue: Zichang Guo <zichangguo@google.com >
> Reviewed-by: Martin Kustermann <kustermann@google.com >
> Reviewed-by: Jonas Termansen <sortie@google.com >
TBR=sortie@google.com ,kustermann@google.com ,zichangguo@google.com
Change-Id: I170eeed56484f2ece3c3b7f1b93f54edf5ae2736
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149743
Reviewed-by: Zichang Guo <zichangguo@google.com >
Commit-Queue: Zichang Guo <zichangguo@google.com >
2020-06-02 19:14:05 +00:00
Zichang Guo
ba25fd190e
[dart:io] Fixes the FileIO performance regression
...
Previous CL (https://dart-review.googlesource.com/c/sdk/+/139881 ) causes
performance regression.
Improves:
FileIO_readwrite_512kb: 196.5%, 224.1%
FileIO_readwrite_verify_512kb: 38.28% 46.71%
Change-Id: I5fb7752f14a2b39238e82bf45b059fe145b9087f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148563
Commit-Queue: Zichang Guo <zichangguo@google.com >
Reviewed-by: Martin Kustermann <kustermann@google.com >
Reviewed-by: Jonas Termansen <sortie@google.com >
2020-06-02 17:47:05 +00:00
Zichang Guo
cdc98a045f
[dart:io] Support abstract unix domain socket on Linux
...
Abstract unix domain socket(UDS) is not supported on platforms other
than Linux/Android. So it has not been supported in the initial design.
This cl will enable users to use abstract UDS.
As long as InternetAddress has a path starting with '@', it will be
interpreted as abstract UDS on Linux/Android.
For abstract UDS, checkout unix man page for more information.
Bug: https://b.corp.google.com/issues/156871566
Change-Id: I393d798b2fc65304677a60639223f90e20aabaa3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148380
Commit-Queue: Zichang Guo <zichangguo@google.com >
Reviewed-by: Siva Annamalai <asiva@google.com >
2020-05-19 21:33:10 +00:00
Zichang Guo
efabc6f848
[dart:io] Fixes _HttpHeaders forcing lowercased Header fields.
...
Outgoing HttpHeaders will use _build() to build headers. This cl make
_build() uses case-sensitive HttpHeaders.
Original change's description:
> [dart:io] Preserve header case in http header _builds()
>
> Bug: https://github.com/dart-lang/sdk/issues/33501
> Change-Id: I57d9bba251b76314bf40b81d1b09bd4643dce4d2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141911
> Commit-Queue: Zichang Guo <zichangguo@google.com >
> Reviewed-by: Siva Annamalai <asiva@google.com >
> Reviewed-by: Jonas Termansen <sortie@google.com >
Bug: https://github.com/dart-lang/sdk/issues/33501
Change-Id: I2d42351b9593d86ad1b2ea248faaea625d321e96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143081
Commit-Queue: Zichang Guo <zichangguo@google.com >
Reviewed-by: Siva Annamalai <asiva@google.com >
2020-05-19 19:24:08 +00:00
Zichang Guo
8fb7471017
[dart:io] Reset _connecting when socket connects failed
...
_connecting doesn't get updated when socket connects failed, which will
block all following connect() from the same HttpClient().
Bug: https://github.com/dart-lang/sdk/issues/34477
Change-Id: I9c24a75efb5ef90b2dc1af65b9efb8ed45a71699
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147688
Reviewed-by: Siva Annamalai <asiva@google.com >
Commit-Queue: Zichang Guo <zichangguo@google.com >
2020-05-18 19:39:07 +00:00
Jonas Termansen
2676764792
[dart:io] Fix late localAddress initialization in non-socket errors.
...
An oversight was made in the dart:io null safety migration where it
wasn't noticed that errors on non-TCP/non-UDP native sockets would read
the late localAddress field that would never be initialized. This
condition can happen for e.g. pipes to other processes where an error
would cause a LateInitializationError instead of a SocketException.
This changelist fixes the problem by making sure the field is never read
except on TCP and UDP sockets, and furthermore statically ensures the
field is always initialized for TCP and UDP sockets.
A regression test is added to reproduce the problem and to confirm it is
indeed fixed by this changelist.
Bug: https://github.com/flutter/flutter/issues/57125
Change-Id: I18f65d94d905d2990afc72e33ce25bda8211606e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148063
Commit-Queue: Jonas Termansen <sortie@google.com >
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com >
2020-05-14 12:41:27 +00:00
Zichang Guo
9a60982089
[dart:io] serialize UnmodifiableListView to Uint8List for file write
...
Bug: https://github.com/dart-lang/sdk/issues/41029
Change-Id: I5902f01a22787922439f0918b6e845eb004b8984
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139881
Reviewed-by: Ryan Macnak <rmacnak@google.com >
Commit-Queue: Zichang Guo <zichangguo@google.com >
2020-05-12 00:19:01 +00:00
Lasse Reichstein Holst Nielsen
58c86e254b
Migrate tests to language/stack_trace.
...
Change-Id: I4f6ac937327a7e610976668377b9cccb03d89d9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146583
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com >
Reviewed-by: Bob Nystrom <rnystrom@google.com >
2020-05-07 13:47:57 +00:00
Ben Konyi
acf7b4bc1d
Update comments in snapshot_fail_test
...
Change-Id: I3ff794dcf88d96931cec75b6b8b8ce8742eed3e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146693
Reviewed-by: Ryan Macnak <rmacnak@google.com >
2020-05-05 23:44:12 +00:00
Zichang Guo
4549484390
[dart:io] tests http parsing decoding latin1
...
Closes https://github.com/dart-lang/sdk/issues/41706
Change-Id: Icde8046b40bb3f77b015a61478b8ef6f94f5870c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145500
Commit-Queue: Zichang Guo <zichangguo@google.com >
Reviewed-by: Jonas Termansen <sortie@google.com >
2020-05-05 20:32:03 +00:00
Ben Konyi
918eae3e5e
Reland "[ dartdev / DDS ] Spawn a Dart Development Service instance when running with --observe via dartdev"
...
This reverts commit 798b6e7c8d .
Change-Id: I5af5eb126d83d8f67b18d5159ead0a276665034e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146661
Reviewed-by: Ryan Macnak <rmacnak@google.com >
Commit-Queue: Ben Konyi <bkonyi@google.com >
2020-05-05 18:48:58 +00:00
Lasse Reichstein Holst Nielsen
7bb38670d2
Don't run tests depending on member names when obfuscated.
...
Bug: http://dartbug.com/41771
Change-Id: I1f4a7d4900e225ca05bb445db0e22e85a71f8723
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146582
Reviewed-by: Tess Strickland <sstrickl@google.com >
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com >
2020-05-05 12:46:54 +00:00
Lasse Reichstein Holst Nielsen
765c9c3a8e
Make tests not assume catch(e) gives e type dynamic.
...
See #41558
Bug: http://dartbug.com/41558
Change-Id: I8980ad6e0d240c917f36ec4f9fcf2091fb61a4b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143819
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com >
Reviewed-by: Bob Nystrom <rnystrom@google.com >
2020-05-05 09:57:23 +00:00
Lasse Reichstein Holst Nielsen
2ca3555c44
Allow NoSuchMethodError.withInvocation to accept any Invocation.
...
Currently the VM only accepts an `_InvocationMirror` instance, not a user created `Invocation`.
Fixes #33124
Bug: http://dartbug.com/33124
Change-Id: Ifdc95861cbe632bc317ca8d9fb92cf0d3ae600f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140100
Reviewed-by: Siva Annamalai <asiva@google.com >
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com >
2020-05-05 08:10:13 +00:00
Nate Bosch
420f50a392
Remove tests for addresses with leading 0s
...
Closes #41727
These are invalid on linux, but treated as valid on mac.
Change-Id: I0ccee97048b163f419ad88f8cfcd3d5cde427ea9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145641
Commit-Queue: Nate Bosch <nbosch@google.com >
Commit-Queue: Alexander Markov <alexmarkov@google.com >
Auto-Submit: Nate Bosch <nbosch@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
2020-04-30 19:30:02 +00:00
Nate Bosch
9b34bee90b
Add InternetAddress.tryParse
...
Closes #40692
Allows a better pattern for parsing user input than catching an
`ArgumentError`.
- Add a new static method to InternetAddress and implement it in all
patch files.
- Add tests which match the tests for the constructor.
Change-Id: Idc76fc4875578f7a381219c0e7e12d1931d98fd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136406
Commit-Queue: Nate Bosch <nbosch@google.com >
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com >
Auto-Submit: Nate Bosch <nbosch@google.com >
2020-04-30 17:19:02 +00:00
Konstantin Shcheglov
8990c063b7
Issue 41603. await voidExpression is an error.
...
Bug: https://github.com/dart-lang/sdk/issues/41603
Change-Id: I6cbd8938c62e7f5f60e48e0ee65b80f4924a3a65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144681
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-04-24 03:42:52 +00:00
Zichang Guo
913cf2583e
Revert "[dart:io] Fixes Ping/Pong mechanism not updating readyState when closing"
...
This reverts commit ac5b24123d .
Reason for revert: Tests are hanging on Windows. https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8882288664919412608/+/steps/test_results/0/logs/new_test_failures__logs_/0
Original change's description:
> [dart:io] Fixes Ping/Pong mechanism not updating readyState when closing
>
> Bug: https://github.com/dart-lang/sdk/issues/33362
> Change-Id: Icf21ad5c9b66c4176ec65e018f9499b24690ed2c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143890
> Commit-Queue: Zichang Guo <zichangguo@google.com >
> Reviewed-by: Jonas Termansen <sortie@google.com >
TBR=sortie@google.com ,asiva@google.com ,zichangguo@google.com
Change-Id: I6f32f4a5bf29d949f26381394ce16e103e715c65
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/33362
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144490
Reviewed-by: Zichang Guo <zichangguo@google.com >
Commit-Queue: Zichang Guo <zichangguo@google.com >
2020-04-22 21:28:11 +00:00
Zichang Guo
ac5b24123d
[dart:io] Fixes Ping/Pong mechanism not updating readyState when closing
...
Bug: https://github.com/dart-lang/sdk/issues/33362
Change-Id: Icf21ad5c9b66c4176ec65e018f9499b24690ed2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143890
Commit-Queue: Zichang Guo <zichangguo@google.com >
Reviewed-by: Jonas Termansen <sortie@google.com >
2020-04-22 20:12:59 +00:00
Siva Annamalai
af4330d382
Revert "[tests] rewrite and format several tests on http"
...
This reverts commit e35120cfd1 .
Reason for revert: This CL caused some breakages in the bot.
Original change's description:
> [tests] rewrite and format several tests on http
>
> Resolve comments in previous cls.
> https://dart-review.googlesource.com/c/sdk/+/140564
> https://dart-review.googlesource.com/c/sdk/+/136322
> https://dart-review.googlesource.com/c/sdk/+/138860
>
> Change-Id: I9549019fe871f35187af5ff75df320748792498b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141845
> Commit-Queue: Zichang Guo <zichangguo@google.com >
> Reviewed-by: Jonas Termansen <sortie@google.com >
TBR=sortie@google.com ,rmacnak@google.com ,zichangguo@google.com
Change-Id: I1ae183dcc4b202b7b1e21d30a1407f9b038791ba
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144306
Reviewed-by: Siva Annamalai <asiva@google.com >
Commit-Queue: Siva Annamalai <asiva@google.com >
2020-04-22 03:27:36 +00:00
Liam Appelbe
87b829bacd
[nnbd] Fix some more strong mode tests
...
All these tests now pass in both weak and strong mode, except for
relation_subclass_test and typedef_reflected_type_test. For those 2
tests I fixed the compile time error and now they have the same runtime
errors in both weak and strong mode (they were already failing at
runtime in weak mode).
Change-Id: If0157f811fffcf72a12ce6690ac0568c8f4419a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144343
Commit-Queue: Liam Appelbe <liama@google.com >
Reviewed-by: Régis Crelier <regis@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
2020-04-22 00:12:24 +00:00
Zichang Guo
e35120cfd1
[tests] rewrite and format several tests on http
...
Resolve comments in previous cls.
https://dart-review.googlesource.com/c/sdk/+/140564
https://dart-review.googlesource.com/c/sdk/+/136322
https://dart-review.googlesource.com/c/sdk/+/138860
Change-Id: I9549019fe871f35187af5ff75df320748792498b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141845
Commit-Queue: Zichang Guo <zichangguo@google.com >
Reviewed-by: Jonas Termansen <sortie@google.com >
2020-04-21 21:41:08 +00:00
Zichang Guo
18bf8c3560
[dart:io] Fix empty Process.run arguments on Windows
...
Closes https://github.com/dart-lang/sdk/issues/40060
Change-Id: I3d8c15efea3b24a628846b090701ffd245f09651
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143700
Commit-Queue: Zichang Guo <zichangguo@google.com >
Reviewed-by: Jonas Termansen <sortie@google.com >
2020-04-17 20:12:54 +00:00
Liam Appelbe
3083050258
[nnbd] Fix some IO strong mode tests
...
Fixes:
standalone/io/directory_test
standalone/io/file_test
standalone/io/http_read_test/*
standalone/io/http_reuse_server_port_test/*
standalone/io/http_server_early_client_close_test/*
standalone/io/regress_8828_test/*
standalone/io/socket_cancel_connect_test/*
standalone/io/socket_finalizer_test/*
standalone/io/web_socket_typed_data_test/*
Change-Id: I46b7d8691b66222b61b72bfe4d29ce81fadf511f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143182
Commit-Queue: Liam Appelbe <liama@google.com >
Reviewed-by: Jonas Termansen <sortie@google.com >
Reviewed-by: Régis Crelier <regis@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
2020-04-14 18:03:55 +00:00
David Morgan
fb0902a05d
Revert "[dart:io] Preserve header case in http header _builds()"
...
This reverts commit af19f9638d .
Reason for revert: Breaks package:shelf tests.
Original change's description:
> [dart:io] Preserve header case in http header _builds()
>
> Bug: https://github.com/dart-lang/sdk/issues/33501
> Change-Id: I57d9bba251b76314bf40b81d1b09bd4643dce4d2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141911
> Commit-Queue: Zichang Guo <zichangguo@google.com >
> Reviewed-by: Siva Annamalai <asiva@google.com >
> Reviewed-by: Jonas Termansen <sortie@google.com >
TBR=sortie@google.com ,asiva@google.com ,zichangguo@google.com
Change-Id: I9c0418a256cb53e415ed0d5aeab84c4b0b4a161d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/33501
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142980
Reviewed-by: David Morgan <davidmorgan@google.com >
Commit-Queue: David Morgan <davidmorgan@google.com >
2020-04-09 10:38:29 +00:00
Zichang Guo
af19f9638d
[dart:io] Preserve header case in http header _builds()
...
Bug: https://github.com/dart-lang/sdk/issues/33501
Change-Id: I57d9bba251b76314bf40b81d1b09bd4643dce4d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141911
Commit-Queue: Zichang Guo <zichangguo@google.com >
Reviewed-by: Siva Annamalai <asiva@google.com >
Reviewed-by: Jonas Termansen <sortie@google.com >
2020-04-09 06:37:28 +00:00
Zichang Guo
8f7b40be77
[dart:io] Throw a FormatException when filters receive bad data.
...
Bug: https://github.com/dart-lang/sdk/issues/41270
Change-Id: Ie4de46129d6fe6ba00fde27f6c1c96cc3f42c888
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141914
Commit-Queue: Zichang Guo <zichangguo@google.com >
Reviewed-by: Jonas Termansen <sortie@google.com >
2020-04-08 20:38:34 +00:00
Mehmet Fidanboylu
74a20b7bfd
Reland "[dart:_http] Allow the embedder to prohibit HTTP traffic."
...
This is a reland of 6b44c631ad
Original change's description:
> [dart:_http] Allow the embedder to prohibit HTTP traffic.
>
> This can be configured by embedders by setting the `_embedderAllowsHttp`
> variable. It can also be overridden by client apps by introducing a
> `Zone` with the variable `#dart.library.io.allow_http` set to `true` or
> `false`.
>
> The default behavior in SDK is unchanged.
>
> Bug: https://github.com/dart-lang/sdk/issues/40548
> Change-Id: Ifec0ad2d759de4bbb836644840d8c312e560f285
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138911
> Commit-Queue: Martin Kustermann <kustermann@google.com >
> Reviewed-by: Jonas Termansen <sortie@google.com >
Bug: https://github.com/dart-lang/sdk/issues/40548
Change-Id: I6ced6c1248b3b6687f6c7d998e5206b2b385f00b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142446
Reviewed-by: Martin Kustermann <kustermann@google.com >
Commit-Queue: Martin Kustermann <kustermann@google.com >
2020-04-06 17:46:44 +00:00
Liam Appelbe
72f292ba73
[nnbd/libs] Fix nullability issues in secure sockets
...
Change-Id: Ia46d0f7cbc3815ca177d840a6322e06179065204
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142422
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Reviewed-by: Jonas Termansen <sortie@google.com >
Commit-Queue: Liam Appelbe <liama@google.com >
2020-04-03 19:37:37 +00:00
Aske Simon Christensen
a5611cdda2
Revert "[dart:_http] Allow the embedder to prohibit HTTP traffic."
...
This reverts commit 6b44c631ad .
Reason for revert: Tests timing out on Windows
Original change's description:
> [dart:_http] Allow the embedder to prohibit HTTP traffic.
>
> This can be configured by embedders by setting the `_embedderAllowsHttp`
> variable. It can also be overridden by client apps by introducing a
> `Zone` with the variable `#dart.library.io.allow_http` set to `true` or
> `false`.
>
> The default behavior in SDK is unchanged.
>
> Bug: https://github.com/dart-lang/sdk/issues/40548
> Change-Id: Ifec0ad2d759de4bbb836644840d8c312e560f285
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138911
> Commit-Queue: Martin Kustermann <kustermann@google.com >
> Reviewed-by: Jonas Termansen <sortie@google.com >
TBR=sortie@google.com ,lrn@google.com ,kustermann@google.com ,mehmetf@google.com
Change-Id: I824a1845e82b5facb839109f74bb482e7095e313
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/40548
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142363
Reviewed-by: Aske Simon Christensen <askesc@google.com >
Commit-Queue: Aske Simon Christensen <askesc@google.com >
2020-04-03 18:19:17 +00:00
Liam Appelbe
7df1498352
[nnbd/libs] Fixing more strong mode tests
...
Change-Id: I5c9080ed75112479ddbeaf6485a5beab3bcb2717
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142209
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Reviewed-by: Jonas Termansen <sortie@google.com >
Commit-Queue: Liam Appelbe <liama@google.com >
2020-04-03 17:30:09 +00:00
Mehmet Fidanboylu
6b44c631ad
[dart:_http] Allow the embedder to prohibit HTTP traffic.
...
This can be configured by embedders by setting the `_embedderAllowsHttp`
variable. It can also be overridden by client apps by introducing a
`Zone` with the variable `#dart.library.io.allow_http` set to `true` or
`false`.
The default behavior in SDK is unchanged.
Bug: https://github.com/dart-lang/sdk/issues/40548
Change-Id: Ifec0ad2d759de4bbb836644840d8c312e560f285
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138911
Commit-Queue: Martin Kustermann <kustermann@google.com >
Reviewed-by: Jonas Termansen <sortie@google.com >
2020-04-03 16:39:26 +00:00
Liam Appelbe
f45e37def2
[nnbd/tests] Fix more HTTP/socket strong mode tests
...
Fixes a heap of tests from standalone/io:
http_proxy_advanced_test
http_proxy_test
http_redirect_test
https_bad_certificate_test
http_shutdown_test/*
https_server_test
raw_secure_server_closing_test/*
raw_secure_socket_pause_test/*
raw_secure_socket_test/*
regress_21160_test
secure_bad_certificate_test
secure_builtin_roots_test
secure_client_raw_server_test/*
secure_client_server_test/*
secure_multiple_client_server_test/*
secure_server_client_certificate_test
secure_server_closing_test/*
secure_server_socket_test/*
secure_session_resume_test/*
secure_socket_alpn_test
secure_socket_test/*
Change-Id: Ica36ec4d6186bc212c690e384529a2030b578bed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142204
Reviewed-by: Jonas Termansen <sortie@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Commit-Queue: Liam Appelbe <liama@google.com >
2020-04-02 19:51:19 +00:00
Liam Appelbe
431a687566
[nnbd/lib] Fix some more strong mode tests
...
These fixes are all working around error handler callbacks that
implicitly return null. I think there's a few other places in
http_impl.dart that need changes like this.
Change-Id: Id3cf3c3ad19a6b4e3bd819815e9500061d8a1697
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142084
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Reviewed-by: Jonas Termansen <sortie@google.com >
Commit-Queue: Liam Appelbe <liama@google.com >
2020-04-02 17:18:44 +00:00
Jonas Termansen
778eb8f1d0
[dart:_http] Fix HeaderValue.parse if valueSeparator is parameterSeparator.
...
Closes https://github.com/dart-lang/sdk/issues/31080 .
Change-Id: Iba235a339c345d1793935f65e3abe6ffdc157cb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140869
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com >
Commit-Queue: Jonas Termansen <sortie@google.com >
2020-03-31 12:46:30 +00:00
Zichang Guo
236dd991e5
[dart:io] Fix parsing the response of the HTTP connect method
...
According to RFC 7231 4.3.6,
A client MUST ignore any "Content-Length" or "Transfer-Encoding" header
fields received in a successful response to CONNECT.
Bug: https://github.com/dart-lang/sdk/issues/37808
Change-Id: I776f54b93807b4b7f9d9c9b9139728fa0415942a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140564
Commit-Queue: Zichang Guo <zichangguo@google.com >
Reviewed-by: Siva Annamalai <asiva@google.com >
Reviewed-by: Jonas Termansen <sortie@google.com >
2020-03-27 20:03:04 +00:00
Johnni Winther
4150349c7c
[cfe] Handle throw in return type inference
...
Closes #41156
Change-Id: I6f5360ccf3f05c2f59de5db703d90431e0d61e7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141100
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2020-03-27 15:59:27 +00:00
Zichang Guo
fdf4762c99
Reland "[dart:io] Fix hanging on zero-length datagram"
...
This is a reland of c326c587c5
The fix is to remove "_availableDatagram" check at the start of receive(). Since receive() can be called without receiver being listening, this check will block the receive().
Original change's description:
> [dart:io] Fix hanging on zero-length datagram
>
> This is observed on Win and Linux.
> Here is a doc to explain the problem: https://docs.google.com/document/d/1ZzyBUMrDHLU6vNryjgSMJfUruOdpmTImtE_s2E0J8IQ/edit?usp=sharing .
>
> Bug: https://github.com/dart-lang/sdk/issues/39910
> Change-Id: Ia961239f45615f14108bcd66043ac33d9a0a4abe
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137425
> Commit-Queue: Zichang Guo <zichangguo@google.com >
> Reviewed-by: Siva Annamalai <asiva@google.com >
Bug: https://github.com/dart-lang/sdk/issues/39910
Change-Id: Iefc0af96ed4e1b433396bb5fe11276e8a04c00d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140164
Reviewed-by: Siva Annamalai <asiva@google.com >
Commit-Queue: Zichang Guo <zichangguo@google.com >
2020-03-27 15:28:23 +00:00
Martin Kustermann
1402e8e1a4
[gardening] Ensure standalone/io/non_utf8_output_test flushes stdout
...
This can remove flakiness of the test, the approval status will be NonUtf8Output.
Change-Id: Ie911547481ed0421632a54a3a74ce93984656948
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141123
Reviewed-by: Teagan Strickland <sstrickl@google.com >
Commit-Queue: Martin Kustermann <kustermann@google.com >
2020-03-26 13:15:18 +00:00
Lasse R.H. Nielsen
8760283247
New implementation of runZoned.
...
A combination of `runZoned` and `runZonedGuarded` where only the latter allows an `onError` parameter,
and only that has a nullable return type.
Retains the `onError` parameter on `runZoned` for now because it's too breaking to remove it until packages have been migrated off of it.
It will be removed in a follow-up CL.
Change-Id: If0e86c8d14e13fa089c66f4af975aeacb2616cf6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137302
Reviewed-by: Jake Macdonald <jakemac@google.com >
Reviewed-by: Nate Bosch <nbosch@google.com >
2020-03-25 00:24:33 +00:00
Johnni Winther
62f84880ef
[cfe] Report error on missing return from non-nullable function
...
Closes #40520
Closes #40948
Closes #40425
Change-Id: I0aa3cfa51b410c90dd0bea963846eeb6b2e73efb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140540
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2020-03-24 08:21:36 +00:00
Zichang Guo
ed83a28d3e
[dart:io] support Unix domain communications
...
Support Unix domain sockets communication on Linux, MacOS and Android.
Changes:
1. Add a field for InternetAddressType named unix.
2. Constructor of InternetAddress gains one more optional field: type. InternetAddress(String address, {InternetAddressType type});
3. Add another constructor to InternetAddress which taks raw address/path for ip/unix addresses as an argument. InternetAddress.fromRawAddress(Uint8List rawAddress, {InternetAddressType type});
The operation for unix domain sockets communication is basically the same as normal sockets except an InternetAddress with type unix should be passed.
Change-Id: I6a1135bbdd7f4e4fc745ccf8f95dec5272b6839b
Bug: https://github.com/dart-lang/sdk/issues/21403
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125932
Commit-Queue: Zichang Guo <zichangguo@google.com >
Reviewed-by: Siva Annamalai <asiva@google.com >
2020-03-23 03:51:40 +00:00
Zichang Guo
e91e09d1e4
Revert "[dart:io] Fix hanging on zero-length datagram"
...
This reverts commit c326c587c5 .
Reason for revert: Analyzer and Co19 test is broken.
https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8885365974080167440/+/steps/test_results/0/logs/new_test_failures__logs_/0
https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8885364415750725248/+/steps/test_results/0/logs/new_test_failures__logs_/0
Original change's description:
> [dart:io] Fix hanging on zero-length datagram
>
> This is observed on Win and Linux.
> Here is a doc to explain the problem: https://docs.google.com/document/d/1ZzyBUMrDHLU6vNryjgSMJfUruOdpmTImtE_s2E0J8IQ/edit?usp=sharing .
>
> Bug: https://github.com/dart-lang/sdk/issues/39910
> Change-Id: Ia961239f45615f14108bcd66043ac33d9a0a4abe
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137425
> Commit-Queue: Zichang Guo <zichangguo@google.com >
> Reviewed-by: Siva Annamalai <asiva@google.com >
TBR=sortie@google.com ,lrn@google.com ,zra@google.com ,asiva@google.com ,zichangguo@google.com
Change-Id: Id84a7cafbc14d6353fa6af8e294e8b0c751a969f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/39910
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140009
Reviewed-by: Zichang Guo <zichangguo@google.com >
Commit-Queue: Zichang Guo <zichangguo@google.com >
2020-03-19 23:05:59 +00:00
Zichang Guo
c326c587c5
[dart:io] Fix hanging on zero-length datagram
...
This is observed on Win and Linux.
Here is a doc to explain the problem: https://docs.google.com/document/d/1ZzyBUMrDHLU6vNryjgSMJfUruOdpmTImtE_s2E0J8IQ/edit?usp=sharing .
Bug: https://github.com/dart-lang/sdk/issues/39910
Change-Id: Ia961239f45615f14108bcd66043ac33d9a0a4abe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137425
Commit-Queue: Zichang Guo <zichangguo@google.com >
Reviewed-by: Siva Annamalai <asiva@google.com >
2020-03-19 20:23:08 +00:00