forked from I2P_Developers/i2p.i2p
add FROM_PORT and TO_PORT to client
This commit is contained in:
@@ -227,7 +227,13 @@ public class SAMStreamSend {
|
||||
_context.statManager().createRateStat("send." + _connectionId + ".started", "When we start", "swarm", new long[] { 5*60*1000 });
|
||||
_context.statManager().createRateStat("send." + _connectionId + ".lifetime", "How long we talk to a peer", "swarm", new long[] { 5*60*1000 });
|
||||
|
||||
byte msg[] = ("STREAM CONNECT ID=" + _connectionId + " DESTINATION=" + _remoteDestination + "\n").getBytes();
|
||||
StringBuilder buf = new StringBuilder(1024);
|
||||
buf.append("STREAM CONNECT ID=").append(_connectionId).append(" DESTINATION=").append(_remoteDestination);
|
||||
// not supported until 3.2 but 3.0-3.1 will ignore
|
||||
if (_isV3)
|
||||
buf.append(" FROM_PORT=1234 TO_PORT=5678");
|
||||
buf.append('\n');
|
||||
byte[] msg = DataHelper.getASCII(buf.toString());
|
||||
synchronized (_samOut) {
|
||||
_samOut.write(msg);
|
||||
_samOut.flush();
|
||||
|
@@ -258,7 +258,8 @@ public class SAMStreamSink {
|
||||
if (!isMaster) {
|
||||
// only for v3
|
||||
//String req = "STREAM ACCEPT SILENT=true ID=" + _v3ID + "\n";
|
||||
String req = "STREAM ACCEPT SILENT=false ID=" + _v3ID + "\n";
|
||||
// TO_PORT not supported until 3.2 but 3.0-3.1 will ignore
|
||||
String req = "STREAM ACCEPT SILENT=false TO_PORT=5678 ID=" + _v3ID + "\n";
|
||||
samOut.write(req.getBytes());
|
||||
samOut.flush();
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
@@ -268,7 +269,7 @@ public class SAMStreamSink {
|
||||
//if (!ok)
|
||||
// throw new IOException("Stream status failed");
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("got STREAM STATUS, awaiting connetion");
|
||||
_log.debug("got STREAM STATUS, awaiting connection");
|
||||
return "OK";
|
||||
}
|
||||
_isV3 = VersionComparator.comp(hisVersion, "3") >= 0;
|
||||
|
Reference in New Issue
Block a user