handle slow arriving input
This commit is contained in:
parent
1576c68a52
commit
d08fced010
|
@ -364,8 +364,11 @@ public abstract class HttpInput<T> extends ServletInputStream implements Runnabl
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setReadListener(ReadListener readListener)
|
public void setReadListener(ReadListener readListener)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
readListener = Objects.requireNonNull(readListener);
|
readListener = Objects.requireNonNull(readListener);
|
||||||
|
boolean content;
|
||||||
synchronized (lock())
|
synchronized (lock())
|
||||||
{
|
{
|
||||||
if (_contentState != STREAM)
|
if (_contentState != STREAM)
|
||||||
|
@ -373,8 +376,18 @@ public abstract class HttpInput<T> extends ServletInputStream implements Runnabl
|
||||||
_contentState = ASYNC;
|
_contentState = ASYNC;
|
||||||
_listener = readListener;
|
_listener = readListener;
|
||||||
_notReady = true;
|
_notReady = true;
|
||||||
|
|
||||||
|
content = getNextContent()!=null;
|
||||||
}
|
}
|
||||||
|
if (content)
|
||||||
_channelState.onReadPossible();
|
_channelState.onReadPossible();
|
||||||
|
else
|
||||||
|
unready();
|
||||||
|
}
|
||||||
|
catch(IOException e)
|
||||||
|
{
|
||||||
|
throw new RuntimeIOException(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void failed(Throwable x)
|
public void failed(Throwable x)
|
||||||
|
|
Loading…
Reference in New Issue