Skip to content

Commit edd16db

Browse files
authored
feat: Expose RTT information
Expose RTT information
2 parents 5c8df85 + 35b4ae4 commit edd16db

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

session.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ func (s *Session) startMeasureRTT() {
379379
}
380380

381381
// 0 if we don't yet have a measurement
382-
func (s *Session) getRTT() time.Duration {
382+
func (s *Session) RTT() time.Duration {
383383
return time.Duration(atomic.LoadInt64(&s.rtt))
384384
}
385385

stream.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ func (s *Stream) sendWindowUpdate(deadline <-chan struct{}) error {
223223
}
224224

225225
now := time.Now()
226-
if rtt := s.session.getRTT(); flags == 0 && rtt > 0 && now.Sub(s.epochStart) < rtt*4 {
226+
if rtt := s.session.RTT(); flags == 0 && rtt > 0 && now.Sub(s.epochStart) < rtt*4 {
227227
var recvWindow uint32
228228
if s.recvWindow > math.MaxUint32/2 {
229229
recvWindow = min(math.MaxUint32, s.session.config.MaxStreamWindowSize)

0 commit comments

Comments
 (0)