@@ -542,10 +542,18 @@ class QUICConnection {
542542 // No `QUICStream` objects could have been created, however quiche stream
543543 // state should be cleaned up, and this can be done synchronously
544544 for ( const streamId of this . conn . readable ( ) as Iterable < StreamId > ) {
545- this . conn . streamShutdown ( streamId , quiche . Shutdown . Read , 0 ) ;
545+ this . conn . streamShutdown (
546+ streamId ,
547+ quiche . Shutdown . Read ,
548+ this . reasonToCode ( 'read' , e ) ,
549+ ) ;
546550 }
547551 for ( const streamId of this . conn . writable ( ) as Iterable < StreamId > ) {
548- this . conn . streamShutdown ( streamId , quiche . Shutdown . Write , 0 ) ;
552+ this . conn . streamShutdown (
553+ streamId ,
554+ quiche . Shutdown . Write ,
555+ this . reasonToCode ( 'write' , e ) ,
556+ ) ;
549557 }
550558 // According to RFC9000, closing while in the middle of a handshake
551559 // should use a transport error code `APPLICATION_ERROR`.
@@ -954,8 +962,16 @@ class QUICConnection {
954962 if ( quicStream == null ) {
955963 if ( this [ running ] === false || this [ status ] === 'stopping' ) {
956964 // We should reject new connections when stopping
957- this . conn . streamShutdown ( streamId , Shutdown . Write , 1 ) ;
958- this . conn . streamShutdown ( streamId , Shutdown . Read , 1 ) ;
965+ this . conn . streamShutdown (
966+ streamId ,
967+ Shutdown . Write ,
968+ this . reasonToCode ( 'write' , errors . ErrorQUICConnectionStopping ) ,
969+ ) ;
970+ this . conn . streamShutdown (
971+ streamId ,
972+ Shutdown . Read ,
973+ this . reasonToCode ( 'read' , errors . ErrorQUICConnectionStopping ) ,
974+ ) ;
959975 continue ;
960976 }
961977
@@ -990,8 +1006,16 @@ class QUICConnection {
9901006 if ( quicStream == null ) {
9911007 if ( this [ running ] === false || this [ status ] === 'stopping' ) {
9921008 // We should reject new connections when stopping
993- this . conn . streamShutdown ( streamId , Shutdown . Write , 1 ) ;
994- this . conn . streamShutdown ( streamId , Shutdown . Read , 1 ) ;
1009+ this . conn . streamShutdown (
1010+ streamId ,
1011+ Shutdown . Write ,
1012+ this . reasonToCode ( 'write' , errors . ErrorQUICConnectionStopping ) ,
1013+ ) ;
1014+ this . conn . streamShutdown (
1015+ streamId ,
1016+ Shutdown . Read ,
1017+ this . reasonToCode ( 'read' , errors . ErrorQUICConnectionStopping ) ,
1018+ ) ;
9951019 continue ;
9961020 }
9971021
0 commit comments