@@ -347,9 +347,6 @@ class QUICConnection extends EventTarget {
347
347
}
348
348
// Sending if
349
349
await this . send ( ) ;
350
- this . logger . debug (
351
- `state are draining: ${ this . conn . isDraining ( ) } , closed: ${ this . conn . isClosed ( ) } ` ,
352
- ) ;
353
350
// If it is not closed, it could still be draining
354
351
this . logger . debug ( 'Waiting for closeP' ) ;
355
352
await this . closedP ;
@@ -494,18 +491,11 @@ class QUICConnection extends EventTarget {
494
491
}
495
492
} finally {
496
493
this . logger . debug ( 'RECV FINALLY' ) ;
497
- this . logger . debug (
498
- ` ________ ED: ${ this . conn . isInEarlyData ( ) } TO: ${ this . conn . isTimedOut ( ) } EST: ${ this . conn . isEstablished ( ) } ` ,
499
- ) ;
500
-
501
494
// Set the timeout
502
495
this . checkTimeout ( ) ;
503
496
// If this call wasn't executed in the midst of a destroy
504
497
// and yet the connection is closed or is draining, then
505
498
// we need to destroy this connection
506
- this . logger . debug (
507
- `state are draining: ${ this . conn . isDraining ( ) } , closed: ${ this . conn . isClosed ( ) } ` ,
508
- ) ;
509
499
if (
510
500
this [ status ] !== 'destroying' &&
511
501
( this . conn . isClosed ( ) || this . conn . isDraining ( ) )
@@ -699,9 +689,6 @@ class QUICConnection extends EventTarget {
699
689
this . deadline = Infinity ;
700
690
// Doing timeout actions
701
691
this . conn . onTimeout ( ) ;
702
- this . logger . debug (
703
- `state are draining: ${ this . conn . isDraining ( ) } , closed: ${ this . conn . isClosed ( ) } ` ,
704
- ) ;
705
692
if ( this [ destroyed ] === false ) await this . send ( ) ;
706
693
if (
707
694
this [ status ] !== 'destroying' &&
@@ -728,36 +715,34 @@ class QUICConnection extends EventTarget {
728
715
this . logger . debug ( 'timeout checking timeout' ) ;
729
716
// During construction, this ends up being null
730
717
const time = this . conn . timeout ( ) ;
731
- this . logger . debug ( `timeout time ${ time } ` ) ;
732
718
if ( time == null ) {
733
719
// Clear timeout
734
- this . logger . debug ( 'timeout clearing timeout' ) ;
720
+ if ( this . timer != null ) this . logger . debug ( 'timeout clearing timeout' ) ;
735
721
clearTimeout ( this . timer ) ;
736
722
delete this . timer ;
737
723
this . deadline = Infinity ;
738
724
} else {
739
725
const newDeadline = Date . now ( ) + time ;
740
726
if ( this . timer != null ) {
741
- this . logger . debug ( 'timeout already running' ) ;
742
727
if ( time === 0 ) {
743
- this . logger . debug ( 'timeout instant timeout' ) ;
728
+ this . logger . debug ( 'timeout triggering instant timeout' ) ;
744
729
// Skip timer and call onTimeout
745
730
setImmediate ( this . onTimeout ) ;
746
731
} else if ( newDeadline < this . deadline ) {
747
- this . logger . debug ( `timeout updating timer` ) ;
732
+ this . logger . debug ( `timeout updating timer with ${ time } delay ` ) ;
748
733
clearTimeout ( this . timer ) ;
749
734
delete this . timer ;
750
735
this . deadline = newDeadline ;
751
736
this . timer = setTimeout ( this . onTimeout , time ) ;
752
737
}
753
738
} else {
754
739
if ( time === 0 ) {
755
- this . logger . debug ( 'timeout instant timeout' ) ;
740
+ this . logger . debug ( 'timeout triggering instant timeout' ) ;
756
741
// Skip timer and call onTimeout
757
742
setImmediate ( this . onTimeout ) ;
758
743
return ;
759
744
}
760
- this . logger . debug ( ' timeout creating timer' ) ;
745
+ this . logger . debug ( ` timeout creating timer with ${ time } delay` ) ;
761
746
this . deadline = newDeadline ;
762
747
this . timer = setTimeout ( this . onTimeout , time ) ;
763
748
}
0 commit comments