Changeset bd82a0c
- Timestamp:
- Dec 6, 2011 9:49:23 PM (9 years ago)
- Branches:
- master
- Children:
- be1d95e
- Parents:
- 0f384c8
- Location:
- router/java/src/net/i2p/router/tunnel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
router/java/src/net/i2p/router/tunnel/HopConfig.java
r0f384c8 rbd82a0c 149 149 buf.append("recv on "); 150 150 buf.append(DataHelper.fromLong(_receiveTunnelId, 0, 4)); 151 buf.append( " ");151 buf.append(' '); 152 152 } 153 153 … … 158 158 } 159 159 160 buf.append(" expiring on ").append(TunnelCreatorConfig.format(_expiration)); 161 buf.append(" having transferred ").append(_messagesProcessed).append("KB"); 160 buf.append(" exp. ").append(TunnelCreatorConfig.format(_expiration)); 161 if (_messagesProcessed > 0) 162 buf.append(" used ").append(_messagesProcessed).append("KB"); 162 163 return buf.toString(); 163 164 } -
router/java/src/net/i2p/router/tunnel/TunnelCreatorConfig.java
r0f384c8 rbd82a0c 209 209 StringBuilder buf = new StringBuilder(128); 210 210 if (_isInbound) 211 buf.append(" inbound");211 buf.append("IB"); 212 212 else 213 buf.append(" outbound");213 buf.append("OB"); 214 214 if (_destination == null) 215 buf.append(" exploratory"); 216 buf.append(": "); 215 buf.append(" expl"); 216 else 217 buf.append(" client ").append(Base64.encode(_destination.getData(), 0, 3)); 218 buf.append(": GW "); 217 219 for (int i = 0; i < _peers.length; i++) { 218 220 buf.append(_peers[i].toBase64().substring(0,4)); … … 221 223 buf.append(_config[i].getReceiveTunnel()); 222 224 else 223 buf.append( 'x');225 buf.append("me"); 224 226 buf.append('.'); 225 227 if (_config[i].getSendTunnel() != null) 226 228 buf.append(_config[i].getSendTunnel()); 227 229 else 228 buf.append( 'x');230 buf.append("me"); 229 231 if (i + 1 < _peers.length) 230 buf.append(" ...");232 buf.append("-->"); 231 233 } 232 234 233 buf.append(" expiring on ").append(getExpirationString()); 234 if (_destination != null) 235 buf.append(" for ").append(Base64.encode(_destination.getData(), 0, 3)); 235 buf.append(" exp. ").append(getExpirationString()); 236 236 if (_replyMessageId > 0) 237 buf.append(" replyMessageId ").append(_replyMessageId); 238 buf.append(" with ").append(_messagesProcessed).append("/").append(_verifiedBytesTransferred).append(" msgs/bytes"); 239 240 buf.append(" with ").append(_failures).append(" failures"); 237 buf.append(" replyMsgID ").append(_replyMessageId); 238 if (_messagesProcessed > 0) 239 buf.append(" with ").append(_messagesProcessed).append("/").append(_verifiedBytesTransferred).append(" msgs/bytes"); 240 241 if (_failures > 0) 242 buf.append(" with ").append(_failures).append(" failures"); 241 243 return buf.toString(); 242 244 } -
router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java
r0f384c8 rbd82a0c 266 266 public void joinOutboundEndpoint(HopConfig cfg) { 267 267 if (_log.shouldLog(Log.INFO)) 268 _log.info("Joining as outbound endpoint: " + cfg);268 _log.info("Joining as OBEP: " + cfg); 269 269 TunnelId recvId = cfg.getReceiveTunnel(); 270 270 OutboundTunnelEndpoint endpoint = new OutboundTunnelEndpoint(_context, cfg, new HopProcessor(_context, cfg, _validator)); … … 285 285 public void joinInboundGateway(HopConfig cfg) { 286 286 if (_log.shouldLog(Log.INFO)) 287 _log.info("Joining as inbound gateway: " + cfg);287 _log.info("Joining as IBGW: " + cfg); 288 288 TunnelGateway.QueuePreprocessor preproc = createPreprocessor(cfg); 289 289 TunnelGateway.Sender sender = new InboundSender(_context, cfg); … … 364 364 public void remove(HopConfig cfg) { 365 365 TunnelId recvId = cfg.getReceiveTunnel(); 366 if (_log.shouldLog(Log.DEBUG))367 _log.debug("removing " + cfg);368 366 369 367 boolean removed = (null != _participatingConfig.remove(recvId)); 370 if (!removed) { 371 if (_log.shouldLog(Log.INFO)) 372 _log.info("Participating tunnel, but no longer listed in participatingConfig? " + cfg); 368 if (removed) { 369 if (_log.shouldLog(Log.DEBUG)) 370 _log.debug("removing " + cfg, new Exception()); 371 } else { 372 // this is normal, this can get called twice 373 if (_log.shouldLog(Log.DEBUG)) 374 _log.debug("Participating tunnel, but no longer listed in participatingConfig? " + cfg, new Exception()); 373 375 } 374 376 … … 838 840 if (exp < now) { 839 841 _configs.poll(); 842 if (_log.shouldLog(Log.INFO)) 843 _log.info("Expiring " + cur); 840 844 remove(cur); 841 845 } else { -
router/java/src/net/i2p/router/tunnel/pool/BuildHandler.java
r0f384c8 rbd82a0c 61 61 private static final int MAX_QUEUE = 192; 62 62 63 private static final int NEXT_HOP_LOOKUP_TIMEOUT = 15*1000; 64 65 /** 66 * This must be high, as if we timeout the send we remove the tunnel from 67 * participating via OnFailedSendJob. 68 * If them msg actually got through then we will be dropping 69 * all the traffic in TunnelDispatcher.dispatch(TunnelDataMessage msg, Hash recvFrom). 70 * 10s was not enough. 71 */ 72 private static final int NEXT_HOP_SEND_TIMEOUT = 15*1000; 73 63 74 public BuildHandler(RouterContext ctx, TunnelPoolManager manager, BuildExecutor exec) { 64 75 _context = ctx; … … 110 121 ctx.inNetMessagePool().registerHandlerJobBuilder(VariableTunnelBuildReplyMessage.MESSAGE_TYPE, tbrmhjb); 111 122 } 112 113 private static final int NEXT_HOP_LOOKUP_TIMEOUT = 15*1000;114 123 115 124 /** … … 651 660 if (!isOutEnd) { 652 661 state.msg.setUniqueId(req.readReplyMessageId()); 653 state.msg.setMessageExpiration(_context.clock().now() + 10*1000);662 state.msg.setMessageExpiration(_context.clock().now() + NEXT_HOP_SEND_TIMEOUT); 654 663 OutNetMessage msg = new OutNetMessage(_context); 655 664 msg.setMessage(state.msg); … … 661 670 _context.outNetMessagePool().add(msg); 662 671 } else { 672 // We are the OBEP. 663 673 // send it to the reply tunnel on the reply peer within a new TunnelBuildReplyMessage 664 674 // (enough layers jrandom?) … … 671 681 replyMsg.setRecord(i, state.msg.getRecord(i)); 672 682 replyMsg.setUniqueId(req.readReplyMessageId()); 673 replyMsg.setMessageExpiration(_context.clock().now() + 10*1000);683 replyMsg.setMessageExpiration(_context.clock().now() + NEXT_HOP_SEND_TIMEOUT); 674 684 TunnelGatewayMessage m = new TunnelGatewayMessage(_context); 675 685 m.setMessage(replyMsg); … … 864 874 */ 865 875 private static class TunnelBuildNextHopFailJob extends JobImpl { 866 final HopConfig _cfg; 876 private final HopConfig _cfg; 877 867 878 private TunnelBuildNextHopFailJob(RouterContext ctx, HopConfig cfg) { 868 879 super(ctx); 869 880 _cfg = cfg; 870 881 } 882 871 883 public String getName() { return "Timeout contacting next peer for tunnel join"; } 884 872 885 public void runJob() { 873 886 getContext().tunnelDispatcher().remove(_cfg); 874 887 getContext().statManager().addRateData("tunnel.rejectTimeout2", 1, 0); 875 // static, no _log 876 //_log.error("Cant contact next hop for " + _cfg); 888 Log log = getContext().logManager().getLog(BuildHandler.class); 889 if (log.shouldLog(Log.WARN)) 890 log.warn("Timeout contacting next hop for " + _cfg); 877 891 } 878 892 }
Note: See TracChangeset
for help on using the changeset viewer.