From 246b376ed96b8ae6d74e1a8d563a12da5c2835a5 Mon Sep 17 00:00:00 2001 From: zzz <zzz@mail.i2p> Date: Sat, 27 Jun 2015 14:58:29 +0000 Subject: [PATCH] tab cleanup --- .../java/src/net/i2p/sam/SAMv3RawSession.java | 55 ++++++++----------- 1 file changed, 22 insertions(+), 33 deletions(-) diff --git a/apps/sam/java/src/net/i2p/sam/SAMv3RawSession.java b/apps/sam/java/src/net/i2p/sam/SAMv3RawSession.java index a228a89437..9cee67791e 100644 --- a/apps/sam/java/src/net/i2p/sam/SAMv3RawSession.java +++ b/apps/sam/java/src/net/i2p/sam/SAMv3RawSession.java @@ -36,45 +36,34 @@ class SAMv3RawSession extends SAMRawSession implements SAMv3Handler.Session, SA * @throws DataFormatException * @throws I2PSessionException */ - public SAMv3RawSession(String nick) - throws IOException, DataFormatException, I2PSessionException { - + public SAMv3RawSession(String nick) throws IOException, DataFormatException, I2PSessionException { super(SAMv3Handler.sSessionsHash.get(nick).getDest(), - SAMv3Handler.sSessionsHash.get(nick).getProps(), - SAMv3Handler.sSessionsHash.get(nick).getHandler() // to be replaced by this - ); + SAMv3Handler.sSessionsHash.get(nick).getProps(), + SAMv3Handler.sSessionsHash.get(nick).getHandler() // to be replaced by this + ); this.nick = nick ; this.recv = this ; // replacement this.server = SAMv3Handler.DatagramServer.getInstance() ; - SAMv3Handler.SessionRecord rec = SAMv3Handler.sSessionsHash.get(nick); - if ( rec==null ) throw new InterruptedIOException() ; - - this.handler = rec.getHandler(); - - Properties props = rec.getProps(); - - - String portStr = props.getProperty("PORT") ; - if ( portStr==null ) { - if (_log.shouldLog(Log.DEBUG)) - _log.debug("receiver port not specified. Current socket will be used."); - this.clientAddress = null; - } - else { - int port = Integer.parseInt(portStr); - - String host = props.getProperty("HOST"); - if ( host==null ) { - host = rec.getHandler().getClientIP(); - + if (rec == null) + throw new InterruptedIOException() ; + this.handler = rec.getHandler(); + Properties props = rec.getProps(); + String portStr = props.getProperty("PORT") ; + if (portStr == null) { if (_log.shouldLog(Log.DEBUG)) - _log.debug("no host specified. Taken from the client socket : " + host +':'+port); - } - - - this.clientAddress = new InetSocketAddress(host,port); - } + _log.debug("receiver port not specified. Current socket will be used."); + this.clientAddress = null; + } else { + int port = Integer.parseInt(portStr); + String host = props.getProperty("HOST"); + if ( host==null ) { + host = rec.getHandler().getClientIP(); + if (_log.shouldLog(Log.DEBUG)) + _log.debug("no host specified. Taken from the client socket : " + host +':'+port); + } + this.clientAddress = new InetSocketAddress(host, port); + } } public void receiveRawBytes(byte[] data, int proto, int fromPort, int toPort) throws IOException { -- GitLab