@@ -145,7 +145,7 @@ enum State
145
145
private long lastSmChangeNumber ;
146
146
private long lastSmPosition ;
147
147
private long lastOverrunThreshold ;
148
- private long timeOfLastSmNs ;
148
+ private long nextSmDeadlineNs ;
149
149
private final long smTimeoutNs ;
150
150
private final long maxReceiverWindowLength ;
151
151
@@ -494,7 +494,7 @@ void deactivate()
494
494
495
495
if (isSendingEosSm )
496
496
{
497
- timeOfLastSmNs = nowNs - smTimeoutNs - 1 ;
497
+ nextSmDeadlineNs = nowNs - 1 ;
498
498
}
499
499
500
500
state (State .DRAINING );
@@ -705,7 +705,7 @@ void checkEosForDrainTransition(final long nowNs)
705
705
timeOfLastStateChangeNs = nowNs ;
706
706
707
707
isSendingEosSm = true ;
708
- timeOfLastSmNs = nowNs - smTimeoutNs - 1 ;
708
+ nextSmDeadlineNs = nowNs - 1 ;
709
709
state (State .DRAINING );
710
710
}
711
711
}
@@ -721,7 +721,7 @@ int sendPendingStatusMessage(final long nowNs)
721
721
{
722
722
int workCount = 0 ;
723
723
final long changeNumber = (long )END_SM_CHANGE_VH .getAcquire (this );
724
- final boolean hasSmTimedOut = ( nowNs - smTimeoutNs ) > timeOfLastSmNs ;
724
+ final boolean hasSmTimedOut = nowNs > nextSmDeadlineNs ;
725
725
726
726
if (null != rejectionReason )
727
727
{
@@ -730,7 +730,7 @@ int sendPendingStatusMessage(final long nowNs)
730
730
channelEndpoint .sendErrorFrame (
731
731
imageConnections , sessionId , streamId , GENERIC_ERROR .value (), rejectionReason );
732
732
733
- timeOfLastSmNs = nowNs ;
733
+ nextSmDeadlineNs = nowNs + smTimeoutNs ;
734
734
workCount ++;
735
735
}
736
736
@@ -765,7 +765,7 @@ int sendPendingStatusMessage(final long nowNs)
765
765
lastSmPosition = smPosition ;
766
766
lastOverrunThreshold = smPosition + (termLength >> 1 );
767
767
lastSmChangeNumber = changeNumber ;
768
- timeOfLastSmNs = nowNs ;
768
+ nextSmDeadlineNs = nowNs + smTimeoutNs ;
769
769
770
770
updateActiveTransportCount ();
771
771
}
@@ -943,7 +943,7 @@ void stopStatusMessagesIfNotActive()
943
943
{
944
944
if (State .ACTIVE != state )
945
945
{
946
- timeOfLastSmNs = Long .MAX_VALUE ;
946
+ nextSmDeadlineNs = Long .MAX_VALUE ;
947
947
}
948
948
}
949
949
0 commit comments