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

Migrate http2 to null safety #78

Merged
merged 3 commits into from
Jan 20, 2021
Merged

Conversation

iinozemtsev
Copy link
Member

No description provided.

@google-cla google-cla bot added the cla: yes label Jan 12, 2021
@iinozemtsev iinozemtsev marked this pull request as draft January 12, 2021 15:42
@iinozemtsev iinozemtsev force-pushed the null_safety branch 2 times, most recently from 2d47391 to b4a1059 Compare January 13, 2021 15:34
@iinozemtsev iinozemtsev marked this pull request as ready for review January 13, 2021 15:35
Copy link
Member

@lrhn lrhn left a comment

Choose a reason for hiding this comment

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

Generally looks very reasonable. I have some suggestions, but see no obvious problems.

experimental/server.dart Outdated Show resolved Hide resolved
@@ -47,7 +47,7 @@ void handleClient(SecureSocket socket) {
connection.incomingStreams.listen((ServerTransportStream stream) async {
dumpInfo('main', 'Got new HTTP/2 stream with id: ${stream.id}');

String path;
String? path;
stream.incomingMessages.listen((StreamMessage msg) async {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Consider using forEach instead of listen when you don't use the subscription (unless you expect the stream to contain errors, which it doesn't seem like).

experimental/server.dart Show resolved Hide resolved
lib/multiprotocol_server.dart Outdated Show resolved Hide resolved
lib/src/async_utils/async_utils.dart Show resolved Hide resolved
lib/src/connection.dart Outdated Show resolved Hide resolved
lib/src/connection.dart Outdated Show resolved Hide resolved
@@ -42,13 +42,13 @@ const List<int> CONNECTION_PREFACE = [
/// connection preface. If an error occurs while reading the connection
/// preface, the returned stream will have only an error.
Stream<List<int>> readConnectionPreface(Stream<List<int>> incoming) {
StreamController<List<int>> result;
StreamSubscription subscription;
late StreamController<List<int>> result;
Copy link
Member

Choose a reason for hiding this comment

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

I'd initialize result = StreamController(); and just set onListen etc. later. Then there is no need for late.

lib/src/connection_preface.dart Outdated Show resolved Hide resolved
lib/src/flowcontrol/stream_queues.dart Outdated Show resolved Hide resolved
@iinozemtsev
Copy link
Member Author

Thanks Lasse! That is very helpful

Analysis exclusions are not needed for these files anymore
@natebosch natebosch merged commit 103e1f3 into dart-lang:master Jan 20, 2021
@eseidel eseidel mentioned this pull request May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants