367048 improved handleRequest guard for suspended requests

This commit is contained in:
Greg Wilkins 2011-12-19 15:15:00 +11:00
parent 44de94f185
commit f767d8d910
2 changed files with 24 additions and 2 deletions

View File

@ -203,6 +203,25 @@ public class AsyncContinuation implements AsyncContext, Continuation
} }
} }
} }
/* ------------------------------------------------------------ */
public boolean isDispatchable()
{
synchronized(this)
{
switch(_state)
{
case __REDISPATCH:
case __REDISPATCHED:
case __REDISPATCHING:
case __COMPLETING:
return true;
default:
return false;
}
}
}
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
@Override @Override

View File

@ -62,8 +62,11 @@ public class AsyncHttpConnection extends AbstractHttpConnection implements Async
try try
{ {
// Handle resumed request // Handle resumed request
if (_request._async.isAsync() && !_request._async.isComplete()) if (_request._async.isAsync())
handleRequest(); {
if ( _request._async.isDispatchable())
handleRequest();
}
// else Parse more input // else Parse more input
else if (!_parser.isComplete() && _parser.parseAvailable()) else if (!_parser.isComplete() && _parser.parseAvailable())
progress=true; progress=true;