fix unit tests broken by previous checkin

This commit is contained in:
zzz
2013-10-18 19:58:39 +00:00
parent bdd9900d0d
commit 012e999354
3 changed files with 4 additions and 16 deletions

View File

@ -186,16 +186,12 @@ public class SSUDemo {
}
private void newPeerRead(RouterInfo ri) {
OutNetMessage out = new OutNetMessage(_us);
FooMessage data = new FooMessage(_us, new byte[] { 0x0, 0x1, 0x2, 0x3 });
// _us.clock() is an ntp synchronized clock. give up on sending this message
// if it doesn't get ACKed within the next 10 seconds
out.setExpiration(_us.clock().now() + 10*1000);
out.setPriority(100);
out.setTarget(ri);
FooMessage data = new FooMessage(_us, new byte[] { 0x0, 0x1, 0x2, 0x3 });
OutNetMessage out = new OutNetMessage(_us, data, _us.clock().now() + 10*1000, 100, ri);
System.out.println("SEND: " + Base64.encode(data.getData()) + " to " +
ri.getIdentity().calculateHash());
out.setMessage(data);
// job fired if we can't contact them, or if it takes too long to get an ACK
out.setOnFailedSendJob(null);
// job fired once the transport gets a full ACK of the message

View File

@ -106,17 +106,13 @@ public class SendGarlicJob extends JobImpl {
}
private void sendGarlic() {
OutNetMessage msg = new OutNetMessage(getContext());
long when = _message.getMessageExpiration(); // + Router.CLOCK_FUDGE_FACTOR;
msg.setExpiration(when);
msg.setMessage(_message);
OutNetMessage msg = new OutNetMessage(getContext(), _message, when, _priority, _config.getRecipient());
msg.setOnFailedReplyJob(_onReplyFailed);
msg.setOnFailedSendJob(_onSendFailed);
msg.setOnReplyJob(_onReply);
msg.setOnSendJob(_onSend);
msg.setPriority(_priority);
msg.setReplySelector(_replySelector);
msg.setTarget(_config.getRecipient());
//_log.info("Sending garlic message to [" + _config.getRecipient() + "] encrypted with " + _config.getRecipientPublicKey() + " or " + _config.getRecipient().getIdentity().getPublicKey());
//_log.debug("Garlic config data:\n" + _config);
//msg.setTarget(_target);

View File

@ -83,14 +83,10 @@ class UDPFlooder implements Runnable {
m.setMessageExpiration(_context.clock().now() + 10*1000);
m.setUniqueId(_context.random().nextLong(I2NPMessage.MAX_ID_VALUE));
if (true) {
OutNetMessage msg = new OutNetMessage(_context);
msg.setMessage(m);
msg.setExpiration(m.getMessageExpiration());
msg.setPriority(500);
RouterInfo to = _context.netDb().lookupRouterInfoLocally(peer.getRemotePeer());
if (to == null)
continue;
msg.setTarget(to);
OutNetMessage msg = new OutNetMessage(_context, m, m.getMessageExpiration(), 500, to);
// warning, getStatLog() can be null
//_context.statManager().getStatLog().addData(peer.getRemotePeer().toBase64().substring(0,6), "udp.floodDataSent", 1, 0);