diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/IrcInboundFilter.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/IrcInboundFilter.java index ce301a48e..5270cbb6b 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/IrcInboundFilter.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/IrcInboundFilter.java @@ -79,7 +79,8 @@ public class IrcInboundFilter implements Runnable { outmsg=outmsg+"\r\n"; // rfc1459 sec. 2.3 output.write(outmsg.getBytes("ISO-8859-1")); // probably doesn't do much but can't hurt - output.flush(); + if (!in.ready()) + output.flush(); } else { if (_log.shouldLog(Log.WARN)) _log.warn("inbound BLOCKED: "+inmsg); diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/IrcOutboundFilter.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/IrcOutboundFilter.java index 5e8c57d99..5e142081a 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/IrcOutboundFilter.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/IrcOutboundFilter.java @@ -79,7 +79,9 @@ public class IrcOutboundFilter implements Runnable { outmsg=outmsg+"\r\n"; // rfc1459 sec. 2.3 output.write(outmsg.getBytes("ISO-8859-1")); // save 250 ms in streaming - output.flush(); + // Check ready() so we don't split the initial handshake up into multiple streaming messages + if (!in.ready()) + output.flush(); } else { if (_log.shouldLog(Log.WARN)) _log.warn("outbound BLOCKED: "+"\""+inmsg+"\""); diff --git a/history.txt b/history.txt index 0dad0b134..760700ad4 100644 --- a/history.txt +++ b/history.txt @@ -1,6 +1,8 @@ 2012-06-21 zzz * I2CP: Make separate message ID counters per-destination, use atomic, increase max (could have caused "local loopback" problems) + * IRC Client: Don't flush output unless out of input, so the + streaming messages don't get split up unnecessarily * OCMOSJ, ElG, Streaming: log tweaks * TunnelInfo: Change msg counter from long to int * TunnelPool: Fix bug where a tunnel was marked as reused when it wasn't