Added GuacamoleReader.available(), using to determine appropriate times to flush tunnel servlet output.

This commit is contained in:
Michael Jumper
2011-12-05 18:54:52 -08:00
parent e0b1427e59
commit f9bcd5f7cf
3 changed files with 29 additions and 2 deletions

View File

@@ -224,8 +224,12 @@ public abstract class GuacamoleTunnelServlet extends HttpServlet {
// Get message output bytes
out.write(message, 0, message.length);
out.flush();
response.flushBuffer();
// Flush if we expect to wait
if (!reader.available()) {
out.flush();
response.flushBuffer();
}
// No more messages another stream can take over
if (tunnel.hasQueuedReaderThreads())