diff --git a/apps/syndie/java/src/net/i2p/syndie/web/PostBean.java b/apps/syndie/java/src/net/i2p/syndie/web/PostBean.java index 57baf2086..f0d24f43f 100644 --- a/apps/syndie/java/src/net/i2p/syndie/web/PostBean.java +++ b/apps/syndie/java/src/net/i2p/syndie/web/PostBean.java @@ -172,6 +172,7 @@ public class PostBean { private static final int MAX_SIZE = 256*1024; private void cacheAttachments() throws IOException { + if (_user == null) throw new IOException("User not specified"); File postCacheDir = new File(BlogManager.instance().getTempDir(), _user.getBlog().toBase64()); if (!postCacheDir.exists()) postCacheDir.mkdirs(); diff --git a/apps/syndie/java/src/net/i2p/syndie/web/PostServlet.java b/apps/syndie/java/src/net/i2p/syndie/web/PostServlet.java index a7cc3d7e8..b063b4d90 100644 --- a/apps/syndie/java/src/net/i2p/syndie/web/PostServlet.java +++ b/apps/syndie/java/src/net/i2p/syndie/web/PostServlet.java @@ -49,6 +49,8 @@ public class PostServlet extends BaseServlet { String action = req.getParameter(PARAM_ACTION); if (!empty(action) && ACTION_CONFIRM.equals(action)) { postEntry(user, req, archive, post, out); + post.reinitialize(); + post.setUser(user); } else { String contentType = req.getContentType(); if (!empty(contentType) && (contentType.indexOf("boundary=") != -1)) { @@ -73,8 +75,8 @@ public class PostServlet extends BaseServlet { out.write(""); - post.reinitialize(); - post.setUser(user); + //post.reinitialize(); + //post.setUser(user); boolean inNewThread = getInNewThread(req.getString(PARAM_IN_NEW_THREAD)); boolean refuseReplies = getRefuseReplies(req.getString(PARAM_REFUSE_REPLIES)); @@ -343,6 +345,7 @@ public class PostServlet extends BaseServlet { bean = new PostBean(); req.getSession().setAttribute(ATTR_POST_BEAN, bean); } + bean.setUser(user); return bean; } diff --git a/history.txt b/history.txt index 31316feb4..e5b95b6c1 100644 --- a/history.txt +++ b/history.txt @@ -1,4 +1,16 @@ -$Id: history.txt,v 1.337 2005/11/29 11:58:01 jrandom Exp $ +$Id: history.txt,v 1.338 2005/11/29 12:56:03 jrandom Exp $ + +2005-11-30 jrandom + * Don't let the TCP transport alone shitlist a peer, since other + transports may be working. Also display whether TCP connections are + inbound or outbound on the peers page. + * Fixed some substantial bugs in the SSU introducers where we wouldn't + talk to anyone who didn't expose an IP (even if they had introducers), + among other goofy things. + * When dealing with SSU introducers, send them all a packet at 3s/6s/9s, + rather than sending one a packet at 3s, then another a packet at 6s, + and a third a packet at 9s. + * Fixed Syndie attachments (oops) 2005-11-29 zzz * Added a link to orion's jump page on the 'key not found' error page. diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index fb921acea..9dd14eaf9 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -15,9 +15,9 @@ import net.i2p.CoreVersion; * */ public class RouterVersion { - public final static String ID = "$Revision: 1.304 $ $Date: 2005/11/29 11:58:02 $"; + public final static String ID = "$Revision: 1.305 $ $Date: 2005/11/29 12:56:02 $"; public final static String VERSION = "0.6.1.6"; - public final static long BUILD = 4; + public final static long BUILD = 5; public static void main(String args[]) { System.out.println("I2P Router version: " + VERSION + "-" + BUILD); System.out.println("Router ID: " + RouterVersion.ID); diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillPeerSelector.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillPeerSelector.java index 15ecfebcb..920e6567a 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillPeerSelector.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillPeerSelector.java @@ -68,8 +68,8 @@ class FloodfillPeerSelector extends PeerSelector { } public List getFloodfillParticipants() { return _floodfillMatches; } public void add(Hash entry) { - if (_context.profileOrganizer().isFailing(entry)) - return; + //if (_context.profileOrganizer().isFailing(entry)) + // return; if ( (_toIgnore != null) && (_toIgnore.contains(entry)) ) return; if (entry.equals(_context.routerHash())) diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java b/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java index 484b46c76..8501383c3 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/KademliaNetworkDatabaseFacade.java @@ -657,8 +657,8 @@ public class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacade { } } else if (routerInfo.getPublished() > now + Router.CLOCK_FUDGE_FACTOR) { long age = routerInfo.getPublished() - _context.clock().now(); - if (_log.shouldLog(Log.WARN)) - _log.warn("Peer " + key.toBase64() + " published their routerInfo in the future?! [" + if (_log.shouldLog(Log.INFO)) + _log.info("Peer " + key.toBase64() + " published their routerInfo in the future?! [" + new Date(routerInfo.getPublished()) + "]", new Exception("Rejecting store")); return "Peer " + key.toBase64() + " published " + DataHelper.formatDuration(age) + " in the future?!"; } else if (_enforceNetId && (routerInfo.getNetworkId() != Router.NETWORK_ID) ){ diff --git a/router/java/src/net/i2p/router/transport/tcp/ConnectionHandler.java b/router/java/src/net/i2p/router/transport/tcp/ConnectionHandler.java index b037c4242..a9ba87576 100644 --- a/router/java/src/net/i2p/router/transport/tcp/ConnectionHandler.java +++ b/router/java/src/net/i2p/router/transport/tcp/ConnectionHandler.java @@ -169,6 +169,7 @@ public class ConnectionHandler { if (_error == null) { if (_log.shouldLog(Log.INFO)) _log.info("Establishment successful! returning the con"); + con.setIsOutbound(false); return con; } else { if (_log.shouldLog(Log.INFO)) diff --git a/router/java/src/net/i2p/router/transport/tcp/TCPConnection.java b/router/java/src/net/i2p/router/transport/tcp/TCPConnection.java index 3da0b01f1..cedf13449 100644 --- a/router/java/src/net/i2p/router/transport/tcp/TCPConnection.java +++ b/router/java/src/net/i2p/router/transport/tcp/TCPConnection.java @@ -43,6 +43,7 @@ public class TCPConnection { private long _lastRead; private long _lastWrite; private long _offsetReceived; + private boolean _isOutbound; public TCPConnection(RouterContext ctx) { _context = ctx; @@ -60,6 +61,7 @@ public class TCPConnection { _lastRead = 0; _lastWrite = 0; _offsetReceived = 0; + _isOutbound = false; _runner = new ConnectionRunner(_context, this); _context.statManager().createRateStat("tcp.probabalisticDropQueueSize", "How many bytes were queued to be sent when a message as dropped probabalistically?", "TCP", new long[] { 60*1000l, 10*60*1000l, 60*60*1000l, 24*60*60*1000l } ); _context.statManager().createRateStat("tcp.queueSize", "How many bytes were queued on a connection?", "TCP", new long[] { 60*1000l, 10*60*1000l, 60*60*1000l, 24*60*60*1000l } ); @@ -86,6 +88,8 @@ public class TCPConnection { public long getOffsetReceived() { return _offsetReceived; } public void setOffsetReceived(long ms) { _offsetReceived = ms; } public TCPTransport getTransport() { return _transport; } + public boolean getIsOutbound() { return _isOutbound; } + public void setIsOutbound(boolean outbound) { _isOutbound = outbound; } /** * Actually start processing the messages on the connection (and reading diff --git a/router/java/src/net/i2p/router/transport/tcp/TCPConnectionEstablisher.java b/router/java/src/net/i2p/router/transport/tcp/TCPConnectionEstablisher.java index 84b78f6a0..ae2991495 100644 --- a/router/java/src/net/i2p/router/transport/tcp/TCPConnectionEstablisher.java +++ b/router/java/src/net/i2p/router/transport/tcp/TCPConnectionEstablisher.java @@ -47,14 +47,17 @@ public class TCPConnectionEstablisher implements Runnable { + info.getIdentity().getHash().toBase64(), e); } if (con != null) { + con.setIsOutbound(true); _transport.connectionEstablished(con); } else { if (!_context.router().isAlive()) return; _transport.addConnectionErrorMessage(cb.getError()); Hash peer = info.getIdentity().getHash(); _context.profileManager().commErrorOccurred(peer); - _context.shitlist().shitlistRouter(peer, "Unable to contact"); - _context.netDb().fail(peer); + // disabling in preparation for dropping tcp, since other transports may work, and + // hence shitlisting is not appropriate + //_context.shitlist().shitlistRouter(peer, "Unable to contact"); + //_context.netDb().fail(peer); } // this removes the _pending block on the address and diff --git a/router/java/src/net/i2p/router/transport/tcp/TCPTransport.java b/router/java/src/net/i2p/router/transport/tcp/TCPTransport.java index 42f2d173b..7bf39523f 100644 --- a/router/java/src/net/i2p/router/transport/tcp/TCPTransport.java +++ b/router/java/src/net/i2p/router/transport/tcp/TCPTransport.java @@ -783,12 +783,21 @@ public class TCPTransport extends TransportImpl { /** Make this stuff pretty (only used in the old console) */ public void renderStatusHTML(Writer out) throws IOException { StringBuffer buf = new StringBuffer(1024); + int outbound = 0; + int inbound = 0; synchronized (_connectionLock) { long offsetTotal = 0; buf.append("Connections (").append(_connectionsByIdent.size()).append("):\n"); + buf.append("Inbound: ").append(inbound).append(", Outbound: ").append(outbound).append("
\n"); } buf.append("Most recent connection errors: