Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Migrate http2 to null safety #78

Merged
merged 3 commits into from
Jan 20, 2021
Merged

Conversation

iinozemtsev
Copy link
Contributor

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

@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

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

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
Contributor Author

Thanks Lasse! That is very helpful

Analysis exclusions are not needed for these files anymore
@natebosch natebosch merged commit 103e1f3 into dart-archive:master Jan 20, 2021
mosuem pushed a commit to dart-lang/http that referenced this pull request Oct 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

3 participants