mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
Merge pull request #145 from glyptodon/http-tunnel-cleanup
GUAC-1096: Properly close() and cleanup HTTP tunnel when end-of-stream is encountered.
This commit is contained in:
@@ -305,8 +305,10 @@ public abstract class GuacamoleHTTPTunnelServlet extends HttpServlet {
|
||||
} while (tunnel.isOpen() && (message = reader.read()) != null);
|
||||
|
||||
// Close tunnel immediately upon EOF
|
||||
if (message == null)
|
||||
if (message == null) {
|
||||
session.detachTunnel(tunnel);
|
||||
tunnel.close();
|
||||
}
|
||||
|
||||
// End-of-instructions marker
|
||||
out.write("0.;");
|
||||
@@ -314,11 +316,18 @@ public abstract class GuacamoleHTTPTunnelServlet extends HttpServlet {
|
||||
response.flushBuffer();
|
||||
}
|
||||
|
||||
// Send end-of-stream marker if connection is closed
|
||||
// Send end-of-stream marker and close tunnel if connection is closed
|
||||
catch (GuacamoleConnectionClosedException e) {
|
||||
|
||||
// Detach and close
|
||||
session.detachTunnel(tunnel);
|
||||
tunnel.close();
|
||||
|
||||
// End-of-instructions marker
|
||||
out.write("0.;");
|
||||
out.flush();
|
||||
response.flushBuffer();
|
||||
|
||||
}
|
||||
|
||||
catch (GuacamoleException e) {
|
||||
|
Reference in New Issue
Block a user