I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Verified Commit 838295c0 authored by zzz's avatar zzz
Browse files

SAM: Improve checks for unset tunnel nickname

parent 005ac387
No related branches found
No related tags found
No related merge requests found
......@@ -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))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment