cleanups
This commit is contained in:
@ -12,7 +12,6 @@ import net.i2p.client.I2PSession;
|
||||
import net.i2p.client.I2PSessionException;
|
||||
import net.i2p.client.I2PSessionMuxedListener;
|
||||
import net.i2p.client.SendMessageOptions;
|
||||
import net.i2p.client.datagram.I2PDatagramDissector;
|
||||
import net.i2p.client.datagram.I2PDatagramMaker;
|
||||
import net.i2p.client.datagram.I2PInvalidDatagramException;
|
||||
import net.i2p.data.DataFormatException;
|
||||
@ -425,6 +424,7 @@ class UDPTrackerClient implements I2PSessionMuxedListener {
|
||||
throw new IllegalArgumentException("don't send to ourselves");
|
||||
|
||||
if (repliable) {
|
||||
// TODO Datagram2
|
||||
I2PDatagramMaker dgMaker = new I2PDatagramMaker(_session);
|
||||
payload = dgMaker.makeI2PDatagram(payload);
|
||||
if (payload == null) {
|
||||
@ -436,11 +436,10 @@ class UDPTrackerClient implements I2PSessionMuxedListener {
|
||||
|
||||
SendMessageOptions opts = new SendMessageOptions();
|
||||
opts.setDate(_context.clock().now() + 60*1000);
|
||||
opts.setTagsToSend(SEND_CRYPTO_TAGS);
|
||||
opts.setTagThreshold(LOW_CRYPTO_TAGS);
|
||||
if (!repliable)
|
||||
opts.setSendLeaseSet(false);
|
||||
try {
|
||||
// TODO Datagram2
|
||||
boolean success = _session.sendMessage(dest, payload, 0, payload.length,
|
||||
repliable ? I2PSession.PROTO_DATAGRAM : I2PSession.PROTO_DATAGRAM_RAW,
|
||||
_rPort, toPort, opts);
|
||||
@ -486,18 +485,26 @@ class UDPTrackerClient implements I2PSessionMuxedListener {
|
||||
return;
|
||||
}
|
||||
|
||||
if (action == ACTION_CONNECT) {
|
||||
switch (action) {
|
||||
case ACTION_CONNECT:
|
||||
receiveConnection(waiter, payload, fromPort);
|
||||
} else if (action == ACTION_ANNOUNCE) {
|
||||
break;
|
||||
|
||||
case ACTION_ANNOUNCE:
|
||||
receiveAnnounce(waiter, payload);
|
||||
} else if (action == ACTION_ERROR) {
|
||||
break;
|
||||
|
||||
case ACTION_ERROR:
|
||||
receiveError(waiter, payload, expect);
|
||||
} else {
|
||||
break;
|
||||
|
||||
default:
|
||||
if (_log.shouldInfo())
|
||||
_log.info("Rcvd msg with unknown action: " + action + " for: " + waiter);
|
||||
waiter.gotReply(false);
|
||||
Tracker tr = waiter.getSentTo();
|
||||
tr.gotError();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user