Skip to content

Commit

Permalink
NetDB: refactor determination of router connection establishment
Browse files Browse the repository at this point in the history
  • Loading branch information
eyedeekay committed Mar 26, 2024
1 parent cdddc62 commit 9e20ba7
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,6 @@ private void sendAck(Hash storedKey) {
msg.setMessageId(_message.getReplyToken());
// Randomize for a little protection against clock-skew fingerprinting.
// But the "arrival" isn't used for anything, right?
// TODO just set to 0?
// TODO we have no session to garlic wrap this with, needs new message
msg.setArrival(getContext().clock().now() - getContext().random().nextInt(3*1000));
// may be null
Expand Down Expand Up @@ -536,7 +535,12 @@ private void sendAck(Hash storedKey) {
}
return;
}
boolean isEstab = getContext().commSystem().isEstablished(toPeer);
DatabaseEntry entry = _message.getEntry();
int type = entry.getType();
// only send direct for RI replies or non-tunnel
boolean isEstab = (type == DatabaseEntry.KEY_TYPE_ROUTERINFO || replyTunnel == null) &&
getContext().commSystem().isEstablished(toPeer);
/*
if (!isEstab && replyTunnel != null) {
DatabaseEntry entry = _message.getEntry();
int type = entry.getType();
Expand Down Expand Up @@ -589,6 +593,7 @@ private void sendAck(Hash storedKey) {
}
}
}
*/
if (isEstab && !_facade.isClientDb()) {
I2NPMessage out1 = msg;
I2NPMessage out2 = msg2;
Expand Down

0 comments on commit 9e20ba7

Please sign in to comment.