demand before succeeding callback in JettyWebSocketFrameHandler

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2019-04-16 17:19:45 +10:00 committed by Greg Wilkins
parent 812f3dbd2e
commit 15d4659cc0
2 changed files with 13 additions and 9 deletions

View File

@ -204,8 +204,17 @@ public class JettyWebSocketFrameHandler implements FrameHandler
// Demand after succeeding any received frame
Callback demandingCallback = Callback.from(()->
{
try
{
demand();
}
catch (Throwable t)
{
callback.failed(t);
return;
}
callback.succeeded();
demand();
},
callback::failed
);

View File

@ -19,7 +19,6 @@
package org.eclipse.jetty.websocket.tests.client;
import java.io.IOException;
import java.net.URI;
import java.time.Duration;
import java.util.ArrayList;
@ -442,14 +441,10 @@ public class ClientCloseTest
session.getRemote().sendString(message);
}
}
catch (InterruptedException e)
catch (Throwable t)
{
LOG.debug("unblocked");
throw new IllegalStateException(e);
}
catch (IOException ignore)
{
LOG.debug(ignore);
LOG.debug(t);
throw new RuntimeException(t);
}
}