-
Notifications
You must be signed in to change notification settings - Fork 46
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
Conversation
2d47391
to
b4a1059
Compare
b4a1059
to
85c49cf
Compare
There was a problem hiding this 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
@@ -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 { |
There was a problem hiding this comment.
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).
lib/src/connection_preface.dart
Outdated
@@ -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; |
There was a problem hiding this comment.
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
.
Thanks Lasse! That is very helpful |
Analysis exclusions are not needed for these files anymore
No description provided.