Fixed recursive flush(): a stack overflow was still possible because the invocation count was not correctly decreased.

This commit is contained in:
Simone Bordet 2012-03-08 15:36:54 +01:00
parent c559383bb2
commit 6d34d6fdc6
1 changed files with 2 additions and 2 deletions

View File

@ -859,7 +859,7 @@ public class StandardSession implements ISession, Parser.Listener, Handler<Stand
// starvation (for the last frames sent) and stack overflow.
// Therefore every some invocation, we dispatch to a new thread
Integer invocations = handlerInvocations.get();
if (invocations >= 8)
if (invocations >= 4)
{
execute(new Runnable()
{
@ -881,7 +881,7 @@ public class StandardSession implements ISession, Parser.Listener, Handler<Stand
}
finally
{
handlerInvocations.set(invocations - 1);
handlerInvocations.set(invocations);
}
}
}