mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	GUAC-906: Implement GuacamoleConnectionClosedException. Throw when read/write fails due to closure.
This commit is contained in:
		| @@ -38,6 +38,7 @@ import org.glyptodon.guacamole.io.GuacamoleReader; | ||||
| import org.glyptodon.guacamole.io.GuacamoleWriter; | ||||
| import org.glyptodon.guacamole.net.GuacamoleTunnel; | ||||
| import org.glyptodon.guacamole.GuacamoleClientException; | ||||
| import org.glyptodon.guacamole.GuacamoleConnectionClosedException; | ||||
| import org.glyptodon.guacamole.protocol.GuacamoleStatus; | ||||
| import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | ||||
| @@ -178,6 +179,10 @@ public abstract class GuacamoleWebSocketTunnelEndpoint extends Endpoint { | ||||
|                         logger.warn("Client request rejected: {}", e.getMessage()); | ||||
|                         closeConnection(session, e.getStatus()); | ||||
|                     } | ||||
|                     catch (GuacamoleConnectionClosedException e) { | ||||
|                         logger.debug("Connection closed.", e); | ||||
|                         closeConnection(session, GuacamoleStatus.SUCCESS); | ||||
|                     } | ||||
|                     catch (GuacamoleException e) { | ||||
|                         logger.error("Internal server error.", e); | ||||
|                         closeConnection(session, e.getStatus()); | ||||
| @@ -205,6 +210,9 @@ public abstract class GuacamoleWebSocketTunnelEndpoint extends Endpoint { | ||||
|             // Write received message | ||||
|             writer.write(message.toCharArray()); | ||||
|         } | ||||
|         catch (GuacamoleConnectionClosedException e) { | ||||
|             logger.debug("Connection closed.", e); | ||||
|         } | ||||
|         catch (GuacamoleException e) { | ||||
|             logger.debug("Tunnel write failed.", e); | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user