Skip to content

Commit 836ee7c

Browse files
Add custom message when terminating a connection
1 parent 32d5ffc commit 836ee7c

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

pkgs/http2/CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## 3.0.0-wip
1+
## 3.0.0
22

33
- Require Dart SDK `3.7.0`.
4+
- Add support for providing custom message when terminating a connection.
45

56
## 2.3.1
67

pkgs/http2/lib/src/connection.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ abstract class Connection {
319319
}
320320

321321
/// Terminates this connection forcefully.
322-
Future<void> terminate([int? errorCode]) {
323-
return _terminate(errorCode ?? ErrorCode.NO_ERROR);
322+
Future<void> terminate([int? errorCode, String? message]) {
323+
return _terminate(errorCode ?? ErrorCode.NO_ERROR, message: message);
324324
}
325325

326326
void _activeStateHandler(bool isActive) =>

pkgs/http2/lib/transport.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ abstract class TransportConnection {
7474
Future finish();
7575

7676
/// Terminates this connection forcefully.
77-
Future terminate([int? errorCode]);
77+
Future terminate([int? errorCode, String? message]);
7878
}
7979

8080
abstract class ClientTransportConnection extends TransportConnection {

pkgs/http2/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: http2
2-
version: 3.0.0-wip
2+
version: 3.0.0
33
description: A HTTP/2 implementation in Dart.
44
repository: https://github.com/dart-lang/http/tree/master/pkgs/http2
55

0 commit comments

Comments
 (0)