This commit is contained in:
Greg Wilkins 2016-06-22 16:31:25 +10:00
parent baae86fcef
commit 59540f552c
1 changed files with 6 additions and 7 deletions

View File

@ -320,7 +320,6 @@ public class HttpChannelState
protected Action unhandle()
{
Action action;
AsyncContextEvent schedule_event=null;
boolean read_interested=false;
if(DEBUG)
@ -378,17 +377,17 @@ public class HttpChannelState
}
else
{
schedule_event=_event;
read_interested=_asyncReadUnready;
_state=State.ASYNC_WAIT;
action=Action.WAIT;
scheduleTimeout();
}
break;
case EXPIRING:
schedule_event=_event;
_state=State.ASYNC_WAIT;
action=Action.WAIT;
scheduleTimeout();
break;
case ERRORING:
@ -414,8 +413,6 @@ public class HttpChannelState
}
}
if (schedule_event!=null)
scheduleTimeout(schedule_event);
if (read_interested)
_channel.asyncReadFillInterested();
return action;
@ -751,11 +748,13 @@ public class HttpChannelState
_channel.execute(_channel);
}
protected void scheduleTimeout(AsyncContextEvent event)
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));
_event.setTimeoutTask(scheduler.schedule(_event,_timeoutMs,TimeUnit.MILLISECONDS));
}
protected void cancelTimeout()