diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java index 0fa4ec79414..c5aa8dd6aae 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpInput.java @@ -58,6 +58,7 @@ public class HttpInput extends ServletInputStream implements Runnable private final HttpChannelState _channelState; private ReadListener _listener; private State _state = STREAM; + private long _firstByteTimeStamp=-1; private long _contentArrived; private long _contentConsumed; private long _blockingTimeoutAt = -1; @@ -88,6 +89,8 @@ public class HttpInput extends ServletInputStream implements Runnable _state = STREAM; _contentArrived = 0; _contentConsumed = 0; + _firstByteTimeStamp = -1; + _blockingTimeoutAt = -1; } } @@ -149,12 +152,12 @@ public class HttpInput extends ServletInputStream implements Runnable _blockingTimeoutAt=now+getHttpChannelState().getHttpChannel().getHttpConfiguration().getBlockingTimeout(); int minRequestDataRate=_channelState.getHttpChannel().getHttpConfiguration().getMinRequestDataRate(); - if (minRequestDataRate>0) + if (minRequestDataRate>0 && _firstByteTimeStamp!=-1) { - long period=now-_channelState.getHttpChannel().getRequest().getTimeStamp(); + long period=now-_firstByteTimeStamp; if (period>=1000) { - double data_rate = _contentArrived / (0.001*(now-_channelState.getHttpChannel().getRequest().getTimeStamp())); + double data_rate = _contentArrived / (0.001*period); if (data_rate