@@ -1666,7 +1666,6 @@ class QuicSession extends EventEmitter {
1666
1666
silentClose : false ,
1667
1667
statelessReset : false ,
1668
1668
stats : undefined ,
1669
- pendingStreams : new Set ( ) ,
1670
1669
streams : new Map ( ) ,
1671
1670
verifyErrorReason : undefined ,
1672
1671
verifyErrorCode : undefined ,
@@ -1969,12 +1968,6 @@ class QuicSession extends EventEmitter {
1969
1968
return ;
1970
1969
state . destroyed = true ;
1971
1970
1972
- // Destroy any pending streams immediately. These
1973
- // are streams that have been created but have not
1974
- // yet been assigned an internal handle.
1975
- for ( const stream of state . pendingStreams )
1976
- stream . destroy ( error ) ;
1977
-
1978
1971
// Destroy any remaining streams immediately.
1979
1972
for ( const stream of state . streams . values ( ) )
1980
1973
stream . destroy ( error ) ;
@@ -2534,7 +2527,7 @@ function streamOnResume() {
2534
2527
}
2535
2528
2536
2529
function streamOnPause ( ) {
2537
- if ( ! this . destroyed /* && !this.pending */ )
2530
+ if ( ! this . destroyed )
2538
2531
this [ kHandle ] . readStop ( ) ;
2539
2532
}
2540
2533
@@ -2658,9 +2651,6 @@ class QuicStream extends Duplex {
2658
2651
if ( this . destroyed || state . closed )
2659
2652
return ;
2660
2653
2661
- if ( this . pending )
2662
- return this . once ( 'ready' , ( ) => this [ kClose ] ( family , code ) ) ;
2663
-
2664
2654
state . closed = true ;
2665
2655
2666
2656
state . aborted = this . readable || this . writable ;
@@ -2712,11 +2702,6 @@ class QuicStream extends Duplex {
2712
2702
// TODO(@jasnell): Implement this later
2713
2703
}
2714
2704
2715
- get pending ( ) {
2716
- // The id is set in the kSetHandle function
2717
- return this [ kInternalState ] . id === undefined ;
2718
- }
2719
-
2720
2705
get aborted ( ) {
2721
2706
return this [ kInternalState ] . aborted ;
2722
2707
}
@@ -2741,16 +2726,6 @@ class QuicStream extends Duplex {
2741
2726
if ( this . destroyed )
2742
2727
return ; // TODO(addaleax): Can this happen?
2743
2728
2744
- // The stream should be corked while still pending
2745
- // but just in case uncork
2746
- // was called early, defer the actual write until the
2747
- // ready event is emitted.
2748
- if ( this . pending ) {
2749
- return this . once ( 'ready' , ( ) => {
2750
- this [ kWriteGeneric ] ( writev , data , encoding , cb ) ;
2751
- } ) ;
2752
- }
2753
-
2754
2729
this [ kUpdateTimer ] ( ) ;
2755
2730
const req = ( writev ) ?
2756
2731
writevGeneric ( this , data , cb ) :
@@ -2774,13 +2749,6 @@ class QuicStream extends Duplex {
2774
2749
// coming so that a fin stream packet can be
2775
2750
// sent.
2776
2751
_final ( cb ) {
2777
- // The QuicStream should be corked while pending
2778
- // so this shouldn't be called, but just in case
2779
- // the stream was prematurely uncorked, defer the
2780
- // operation until the ready event is emitted.
2781
- if ( this . pending )
2782
- return this . once ( 'ready' , ( ) => this . _final ( cb ) ) ;
2783
-
2784
2752
const handle = this [ kHandle ] ;
2785
2753
if ( handle === undefined ) {
2786
2754
cb ( ) ;
@@ -2796,9 +2764,6 @@ class QuicStream extends Duplex {
2796
2764
}
2797
2765
2798
2766
_read ( nread ) {
2799
- if ( this . pending )
2800
- return this . once ( 'ready' , ( ) => this . _read ( nread ) ) ;
2801
-
2802
2767
if ( this . destroyed ) { // TODO(addaleax): Can this happen?
2803
2768
this . push ( null ) ;
2804
2769
return ;
@@ -2848,12 +2813,6 @@ class QuicStream extends Duplex {
2848
2813
else if ( typeof fd !== 'number' )
2849
2814
throw new ERR_INVALID_ARG_TYPE ( 'fd' , [ 'number' , 'FileHandle' ] , fd ) ;
2850
2815
2851
- if ( this . pending ) {
2852
- return this . once ( 'ready' , ( ) => {
2853
- this . sendFD ( fd , { offset, length } , ownsFd ) ;
2854
- } ) ;
2855
- }
2856
-
2857
2816
this [ kUpdateTimer ] ( ) ;
2858
2817
this . ownsFd = ownsFd ;
2859
2818
0 commit comments