Fixes #624 cleanup

This commit is contained in:
Greg Wilkins 2016-06-22 16:47:00 +10:00
parent 59540f552c
commit 126e58c7cc
1 changed files with 3 additions and 11 deletions

View File

@ -380,14 +380,15 @@ public class HttpChannelState
read_interested=_asyncReadUnready;
_state=State.ASYNC_WAIT;
action=Action.WAIT;
scheduleTimeout();
Scheduler scheduler = _channel.getScheduler();
if (scheduler!=null && _timeoutMs>0)
_event.setTimeoutTask(scheduler.schedule(_event,_timeoutMs,TimeUnit.MILLISECONDS));
}
break;
case EXPIRING:
_state=State.ASYNC_WAIT;
action=Action.WAIT;
scheduleTimeout();
break;
case ERRORING:
@ -748,15 +749,6 @@ public class HttpChannelState
_channel.execute(_channel);
}
protected void scheduleTimeout()
{
if (!_locker.isLocked())
throw new IllegalStateException();
Scheduler scheduler = _channel.getScheduler();
if (scheduler!=null && _timeoutMs>0)
_event.setTimeoutTask(scheduler.schedule(_event,_timeoutMs,TimeUnit.MILLISECONDS));
}
protected void cancelTimeout()
{
final AsyncContextEvent event;