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

Skip to content
Snippets Groups Projects
Commit 832c0ff6 authored by zzz's avatar zzz
Browse files

* SAM: Force i2cp.messageReliability=None (ticket #819)

parent 95b4fe73
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,7 @@ import java.util.Properties; ...@@ -21,6 +21,7 @@ import java.util.Properties;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import net.i2p.I2PException; import net.i2p.I2PException;
import net.i2p.client.I2PClient;
import net.i2p.client.I2PSessionException; import net.i2p.client.I2PSessionException;
import net.i2p.data.Base64; import net.i2p.data.Base64;
import net.i2p.data.DataFormatException; import net.i2p.data.DataFormatException;
...@@ -253,6 +254,11 @@ public class SAMv1Handler extends SAMHandler implements SAMRawReceiver, SAMDatag ...@@ -253,6 +254,11 @@ public class SAMv1Handler extends SAMHandler implements SAMRawReceiver, SAMDatag
} }
props.remove("STYLE"); props.remove("STYLE");
// Unconditionally override what the client may have set
// (iMule sets BestEffort) as None is more efficient
// and the client has no way to access delivery notifications
props.setProperty(I2PClient.PROP_RELIABILITY, I2PClient.PROP_RELIABILITY_NONE);
if (style.equals("RAW")) { if (style.equals("RAW")) {
rawSession = new SAMRawSession(destKeystream, props, this); rawSession = new SAMRawSession(destKeystream, props, this);
} else if (style.equals("DATAGRAM")) { } else if (style.equals("DATAGRAM")) {
......
...@@ -26,6 +26,7 @@ import java.util.HashMap; ...@@ -26,6 +26,7 @@ import java.util.HashMap;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import net.i2p.I2PException; import net.i2p.I2PException;
import net.i2p.client.I2PClient;
import net.i2p.client.I2PSessionException; import net.i2p.client.I2PSessionException;
import net.i2p.data.Base64; import net.i2p.data.Base64;
import net.i2p.data.DataFormatException; import net.i2p.data.DataFormatException;
...@@ -514,7 +515,10 @@ public class SAMv3Handler extends SAMv1Handler ...@@ -514,7 +515,10 @@ public class SAMv3Handler extends SAMv1Handler
} }
props.remove("STYLE"); props.remove("STYLE");
// Unconditionally override what the client may have set
// (iMule sets BestEffort) as None is more efficient
// and the client has no way to access delivery notifications
i2cpProps.setProperty(I2PClient.PROP_RELIABILITY, I2PClient.PROP_RELIABILITY_NONE);
// Record the session in the database sSessionsHash // Record the session in the database sSessionsHash
Properties allProps = new Properties(); Properties allProps = new Properties();
......
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