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

This commit is contained in:
Michael Jumper committed 2011-12-05 18:54:52 -08:00
1 parent e0b1427e59
commit f9bcd5f7cf
3 files changed
+29 -2

No files matched your search

@@ -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())