forked from I2P_Developers/i2p.i2p
SAM: Improve checks for unset tunnel nickname
This commit is contained in:
@@ -261,10 +261,14 @@ abstract class SAMMessageSession implements SAMMessageSess {
|
||||
_log.debug("Instantiating new SAM message-based session handler");
|
||||
|
||||
I2PClient client = I2PClientFactory.createClient();
|
||||
if (!props.containsKey("inbound.nickname") && !props.containsKey("outbound.nickname")) {
|
||||
props.setProperty("inbound.nickname", "SAM UDP Client");
|
||||
props.setProperty("outbound.nickname", "SAM UDP Client");
|
||||
String name = props.getProperty("inbound.nickname");
|
||||
if (name == null || name.trim().isEmpty()) {
|
||||
name = "SAM UDP Client";
|
||||
props.setProperty("inbound.nickname", name);
|
||||
}
|
||||
String name2 = props.getProperty("outbound.nickname");
|
||||
if (name2 == null || name2.trim().isEmpty())
|
||||
props.setProperty("outbound.nickname", name);
|
||||
_session = client.createSession(destStream, props);
|
||||
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
|
||||
@@ -162,10 +162,14 @@ class SAMStreamSession implements SAMMessageSess {
|
||||
}
|
||||
if (!canReceive)
|
||||
allprops.setProperty("i2cp.dontPublishLeaseSet", "true");
|
||||
if (!allprops.containsKey("inbound.nickname") && !allprops.containsKey("outbound.nickname")) {
|
||||
allprops.setProperty("inbound.nickname", "SAM TCP Client");
|
||||
allprops.setProperty("outbound.nickname", "SAM TCP Client");
|
||||
String name = allprops.getProperty("inbound.nickname");
|
||||
if (name == null || name.trim().isEmpty()) {
|
||||
name = "SAM TCP Client";
|
||||
allprops.setProperty("inbound.nickname", name);
|
||||
}
|
||||
String name2 = allprops.getProperty("outbound.nickname");
|
||||
if (name2 == null || name2.trim().isEmpty())
|
||||
allprops.setProperty("outbound.nickname", name);
|
||||
|
||||
_isOwnSession = true;
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
|
||||
Reference in New Issue
Block a user