allow the user to override the I2CP options (exposed on the command line, ala

SAMBridge [[listenHost ]listenPort[ name=val]*]
where listenHost defaults to localhost, listenPort defaults to 7656, and name=val
can be the I2CP options to override (e.g. i2cp.tcp.host=localhost i2cp.tcp.port=4001)
This commit is contained in:
jrandom
2004-04-20 07:26:34 +00:00
committed by zzz
parent bed7d09764
commit 203d0e870a
4 changed files with 144 additions and 65 deletions

View File

@@ -31,10 +31,11 @@ public class SAMHandlerFactory {
* required by the client.
*
* @param s Socket attached to SAM client
* @param i2cpProps config options for our i2cp connection
*
* @return A SAM protocol handler
*/
public static SAMHandler createSAMHandler(Socket s) throws SAMException {
public static SAMHandler createSAMHandler(Socket s, Properties i2cpProps) throws SAMException {
BufferedReader br;
String line;
StringTokenizer tok;
@@ -127,7 +128,7 @@ public class SAMHandlerFactory {
try {
switch (verMajor) {
case 1:
handler = new SAMv1Handler(s, verMajor, verMinor);
handler = new SAMv1Handler(s, verMajor, verMinor, i2cpProps);
break;
default:
_log.error("BUG! Trying to initialize the wrong SAM version!");