set the read listener only after all checks are done
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
parent
1494a05327
commit
14108c8e58
|
@ -210,10 +210,10 @@ public class HttpInput extends ServletInputStream implements Runnable
|
||||||
LOG.debug("setting read listener to {} {}", readListener, this);
|
LOG.debug("setting read listener to {} {}", readListener, this);
|
||||||
if (_readListener != null)
|
if (_readListener != null)
|
||||||
throw new IllegalStateException("ReadListener already set");
|
throw new IllegalStateException("ReadListener already set");
|
||||||
_readListener = Objects.requireNonNull(readListener);
|
|
||||||
//illegal if async not started
|
//illegal if async not started
|
||||||
if (!_channelState.isAsyncStarted())
|
if (!_channelState.isAsyncStarted())
|
||||||
throw new IllegalStateException("Async not started");
|
throw new IllegalStateException("Async not started");
|
||||||
|
_readListener = Objects.requireNonNull(readListener);
|
||||||
|
|
||||||
_contentProducer = _asyncContentProducer;
|
_contentProducer = _asyncContentProducer;
|
||||||
// trigger content production
|
// trigger content production
|
||||||
|
|
Loading…
Reference in New Issue