tab cleanup

This commit is contained in:
zzz
2015-06-27 14:58:29 +00:00
parent 194f20e18c
commit 246b376ed9

View File

@ -36,45 +36,34 @@ class SAMv3RawSession extends SAMRawSession implements SAMv3Handler.Session, SA
* @throws DataFormatException * @throws DataFormatException
* @throws I2PSessionException * @throws I2PSessionException
*/ */
public SAMv3RawSession(String nick) public SAMv3RawSession(String nick) throws IOException, DataFormatException, I2PSessionException {
throws IOException, DataFormatException, I2PSessionException {
super(SAMv3Handler.sSessionsHash.get(nick).getDest(), super(SAMv3Handler.sSessionsHash.get(nick).getDest(),
SAMv3Handler.sSessionsHash.get(nick).getProps(), SAMv3Handler.sSessionsHash.get(nick).getProps(),
SAMv3Handler.sSessionsHash.get(nick).getHandler() // to be replaced by this SAMv3Handler.sSessionsHash.get(nick).getHandler() // to be replaced by this
); );
this.nick = nick ; this.nick = nick ;
this.recv = this ; // replacement this.recv = this ; // replacement
this.server = SAMv3Handler.DatagramServer.getInstance() ; this.server = SAMv3Handler.DatagramServer.getInstance() ;
SAMv3Handler.SessionRecord rec = SAMv3Handler.sSessionsHash.get(nick); SAMv3Handler.SessionRecord rec = SAMv3Handler.sSessionsHash.get(nick);
if ( rec==null ) throw new InterruptedIOException() ; if (rec == null)
throw new InterruptedIOException() ;
this.handler = rec.getHandler(); this.handler = rec.getHandler();
Properties props = rec.getProps();
Properties props = rec.getProps(); String portStr = props.getProperty("PORT") ;
if (portStr == null) {
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 (_log.shouldLog(Log.DEBUG)) if (_log.shouldLog(Log.DEBUG))
_log.debug("no host specified. Taken from the client socket : " + host +':'+port); _log.debug("receiver port not specified. Current socket will be used.");
} this.clientAddress = null;
} else {
int port = Integer.parseInt(portStr);
this.clientAddress = new InetSocketAddress(host,port); 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 { public void receiveRawBytes(byte[] data, int proto, int fromPort, int toPort) throws IOException {