Issue #1074 javadoc
This commit is contained in:
parent
a7048a325a
commit
62331ce8f0
|
@ -260,6 +260,7 @@ public class HttpInput extends ServletInputStream implements Runnable
|
||||||
int l;
|
int l;
|
||||||
synchronized (_inputQ)
|
synchronized (_inputQ)
|
||||||
{
|
{
|
||||||
|
// Setup blocking only if not async
|
||||||
if (!isAsync())
|
if (!isAsync())
|
||||||
{
|
{
|
||||||
if (_blockUntil == 0)
|
if (_blockUntil == 0)
|
||||||
|
@ -270,6 +271,7 @@ public class HttpInput extends ServletInputStream implements Runnable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Caclulate minimum request rate for DOS protection
|
||||||
long minRequestDataRate = _channelState.getHttpChannel().getHttpConfiguration().getMinRequestDataRate();
|
long minRequestDataRate = _channelState.getHttpChannel().getHttpConfiguration().getMinRequestDataRate();
|
||||||
if (minRequestDataRate > 0 && _firstByteTimeStamp != -1)
|
if (minRequestDataRate > 0 && _firstByteTimeStamp != -1)
|
||||||
{
|
{
|
||||||
|
@ -282,6 +284,7 @@ public class HttpInput extends ServletInputStream implements Runnable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Consume content looking for bytes to read
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
Content item = nextContent();
|
Content item = nextContent();
|
||||||
|
@ -297,9 +300,13 @@ public class HttpInput extends ServletInputStream implements Runnable
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// No content, so should we block?
|
||||||
if (!_state.blockForContent(this))
|
if (!_state.blockForContent(this))
|
||||||
{
|
{
|
||||||
|
// Not blocking, so what should we return?
|
||||||
l = _state.noContent();
|
l = _state.noContent();
|
||||||
|
|
||||||
|
// If EOF do we need to wake for allDataRead callback?
|
||||||
if (l<0)
|
if (l<0)
|
||||||
wake = _channelState.onReadEof();
|
wake = _channelState.onReadEof();
|
||||||
break;
|
break;
|
||||||
|
@ -801,9 +808,7 @@ public class HttpInput extends ServletInputStream implements Runnable
|
||||||
synchronized (_inputQ)
|
synchronized (_inputQ)
|
||||||
{
|
{
|
||||||
listener = _listener;
|
listener = _listener;
|
||||||
if (_channelState.isAsyncComplete())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (_state == EOF)
|
if (_state == EOF)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -837,10 +842,7 @@ public class HttpInput extends ServletInputStream implements Runnable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (content==null)
|
else if (content==null)
|
||||||
{
|
throw new IllegalStateException();
|
||||||
LOG.warn("spurious run!");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue