Exemplo n.º 1
0
 private void send(TunnelDataMessage msg, RouterInfo ri) {
   if (_log.shouldLog(Log.DEBUG))
     _log.debug("forwarding encrypted data out " + _config + ": " + msg.getUniqueId());
   OutNetMessage m = new OutNetMessage(_context);
   m.setMessage(msg);
   m.setExpiration(msg.getMessageExpiration());
   m.setTarget(ri);
   m.setPriority(PRIORITY);
   _context.outNetMessagePool().add(m);
   _config.incrementProcessedMessages();
 }
Exemplo n.º 2
0
 /**
  * Add a message to be sent down the tunnel (immediately forwarding it to the {@link
  * InboundMessageDistributor} or {@link OutboundMessageDistributor}, as necessary).
  *
  * @param msg message to be sent through the tunnel
  * @param toRouter router to send to after the endpoint (or null for endpoint processing)
  * @param toTunnel tunnel to send to after the endpoint (or null for endpoint or router
  *     processing)
  */
 @Override
 public void add(I2NPMessage msg, Hash toRouter, TunnelId toTunnel) {
   if (_log.shouldLog(Log.DEBUG))
     _log.debug(
         "zero hop gateway: distribute "
             + (_config.isInbound() ? "inbound" : " outbound")
             + " to "
             + (toRouter != null ? toRouter.toBase64().substring(0, 4) : "")
             + "."
             + (toTunnel != null ? toTunnel.getTunnelId() + "" : "")
             + ": "
             + msg);
   if (_config.isInbound()) {
     _inDistributor.distribute(msg, toRouter, toTunnel);
   } else {
     _outDistributor.distribute(msg, toRouter, toTunnel);
   }
   _config.incrementProcessedMessages();
 }