diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java index 43e85bf496..8b8d49b090 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java @@ -139,9 +139,11 @@ public class IndexBean { return stop(); else if ("start".equals(_action)) return start(); - else if ("Save changes".equals(_action)) + else if ("Save changes".equals(_action) || // IE workaround: + (_action.toLowerCase().indexOf("save") >= 0)) return saveChanges(); - else if ("Delete this proxy".equals(_action)) + else if ("Delete this proxy".equals(_action) || // IE workaround: + (_action.toLowerCase().indexOf("delete") >= 0)) return deleteTunnel(); else return "Action " + _action + " unknown"; diff --git a/apps/streaming/java/src/net/i2p/client/streaming/Connection.java b/apps/streaming/java/src/net/i2p/client/streaming/Connection.java index a3329f3c6a..1e7fa629b8 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/Connection.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/Connection.java @@ -298,7 +298,7 @@ public class Connection { if (_log.shouldLog(Log.DEBUG)) _log.debug("Resend in " + timeout + " for " + packet, new Exception("Sent by")); - SimpleTimer.getInstance().addEvent(new ResendPacketEvent(packet, timeout + _context.clock().now()), timeout); + RetransmissionTimer.getInstance().addEvent(new ResendPacketEvent(packet, timeout + _context.clock().now()), timeout); } _context.statManager().getStatLog().addData(Packet.toId(_sendStreamId), "stream.rtt", _options.getRTT(), _options.getWindowSize()); @@ -758,8 +758,8 @@ public class Connection { if (_log.shouldLog(Log.DEBUG)) _log.debug("Resetting the inactivity timer to " + howLong, new Exception("Reset by")); // this will get rescheduled, and rescheduled, and rescheduled... - SimpleTimer.getInstance().removeEvent(_activityTimer); - SimpleTimer.getInstance().addEvent(_activityTimer, howLong); + RetransmissionTimer.getInstance().removeEvent(_activityTimer); + RetransmissionTimer.getInstance().addEvent(_activityTimer, howLong); } private class ActivityTimer implements SimpleTimer.TimedEvent { @@ -773,7 +773,7 @@ public class Connection { long left = getTimeLeft(); if (left > 0) { if (_log.shouldLog(Log.DEBUG)) _log.debug("Inactivity timeout reached, but there is time left (" + left + ")"); - SimpleTimer.getInstance().addEvent(ActivityTimer.this, left); + RetransmissionTimer.getInstance().addEvent(ActivityTimer.this, left); return; } // these are either going to time out or cause further rescheduling @@ -963,7 +963,7 @@ public class Connection { if (_log.shouldLog(Log.WARN)) _log.warn("Delaying resend of " + _packet + " as there are " + _activeResends + " active resends already in play"); - SimpleTimer.getInstance().addEvent(ResendPacketEvent.this, 1000); + RetransmissionTimer.getInstance().addEvent(ResendPacketEvent.this, 1000); _nextSendTime = 1000 + _context.clock().now(); return false; } @@ -1055,7 +1055,7 @@ public class Connection { timeout = MAX_RESEND_DELAY; if (_log.shouldLog(Log.DEBUG)) _log.debug("Scheduling resend in " + timeout + "ms for " + _packet); - SimpleTimer.getInstance().addEvent(ResendPacketEvent.this, timeout); + RetransmissionTimer.getInstance().addEvent(ResendPacketEvent.this, timeout); _nextSendTime = timeout + _context.clock().now(); } return true; diff --git a/apps/streaming/java/src/net/i2p/client/streaming/ConnectionHandler.java b/apps/streaming/java/src/net/i2p/client/streaming/ConnectionHandler.java index 471cc97a87..4960f1a228 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/ConnectionHandler.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/ConnectionHandler.java @@ -50,7 +50,7 @@ class ConnectionHandler { } if (_log.shouldLog(Log.DEBUG)) _log.debug("Receive new SYN: " + packet + ": timeout in " + _acceptTimeout); - SimpleTimer.getInstance().addEvent(new TimeoutSyn(packet), _acceptTimeout); + RetransmissionTimer.getInstance().addEvent(new TimeoutSyn(packet), _acceptTimeout); synchronized (_synQueue) { _synQueue.add(packet); _synQueue.notifyAll(); diff --git a/apps/streaming/java/src/net/i2p/client/streaming/ConnectionPacketHandler.java b/apps/streaming/java/src/net/i2p/client/streaming/ConnectionPacketHandler.java index 2c4a4f3cfa..be27fb71d6 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/ConnectionPacketHandler.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/ConnectionPacketHandler.java @@ -155,7 +155,7 @@ public class ConnectionPacketHandler { // take note of congestion if (_log.shouldLog(Log.WARN)) _log.warn("congestion.. dup " + packet); - SimpleTimer.getInstance().addEvent(new AckDup(con), con.getOptions().getSendAckDelay()); + RetransmissionTimer.getInstance().addEvent(new AckDup(con), con.getOptions().getSendAckDelay()); //con.setNextSendTime(_context.clock().now() + con.getOptions().getSendAckDelay()); //fastAck = true; } else { diff --git a/apps/streaming/java/src/net/i2p/client/streaming/MessageOutputStream.java b/apps/streaming/java/src/net/i2p/client/streaming/MessageOutputStream.java index 64a7bb6cc2..89fd9d7a7a 100644 --- a/apps/streaming/java/src/net/i2p/client/streaming/MessageOutputStream.java +++ b/apps/streaming/java/src/net/i2p/client/streaming/MessageOutputStream.java @@ -194,7 +194,7 @@ public class MessageOutputStream extends OutputStream { // no need to be overly worried about duplicates - it would just // push it further out if (!_enqueued) { - SimpleTimer.getInstance().addEvent(_flusher, _passiveFlushDelay); + RetransmissionTimer.getInstance().addEvent(_flusher, _passiveFlushDelay); if (_log.shouldLog(Log.DEBUG)) _log.debug("Enqueueing the flusher for " + _passiveFlushDelay + "ms out"); } else { diff --git a/apps/streaming/java/src/net/i2p/client/streaming/RetransmissionTimer.java b/apps/streaming/java/src/net/i2p/client/streaming/RetransmissionTimer.java new file mode 100644 index 0000000000..0ea0c83d70 --- /dev/null +++ b/apps/streaming/java/src/net/i2p/client/streaming/RetransmissionTimer.java @@ -0,0 +1,12 @@ +package net.i2p.client.streaming; + +import net.i2p.util.SimpleTimer; + +/** + * + */ +class RetransmissionTimer extends SimpleTimer { + private static final RetransmissionTimer _instance = new RetransmissionTimer(); + public static final SimpleTimer getInstance() { return _instance; } + protected RetransmissionTimer() { super("StreamingTimer"); } +} diff --git a/apps/syndie/java/src/net/i2p/syndie/sml/HTMLRenderer.java b/apps/syndie/java/src/net/i2p/syndie/sml/HTMLRenderer.java index a7f6cd1118..0dc0819946 100644 --- a/apps/syndie/java/src/net/i2p/syndie/sml/HTMLRenderer.java +++ b/apps/syndie/java/src/net/i2p/syndie/sml/HTMLRenderer.java @@ -341,14 +341,16 @@ public class HTMLRenderer extends EventReceiverImpl { } - String url = getPageURL(blog, null, -1, -1, -1, (_user != null ? _user.getShowExpanded() : false), (_user != null ? _user.getShowImages() : false)); + //String url = getPageURL(blog, null, -1, -1, -1, (_user != null ? _user.getShowExpanded() : false), (_user != null ? _user.getShowImages() : false)); + String url = getMetadataURL(blog); _bodyBuffer.append(getSpan("blogEntrySummary")).append(" ["); if ( (name != null) && (name.trim().length() > 0) ) _bodyBuffer.append(sanitizeString(name)); else _bodyBuffer.append("view"); - _bodyBuffer.append(" (meta)"); + _bodyBuffer.append(" "); + //_bodyBuffer.append(" (meta)"); if ( (tag != null) && (tag.trim().length() > 0) ) { url = getPageURL(blog, tag, -1, -1, -1, false, false); _bodyBuffer.append(" 0) ) { buf.append(PARAM_VIEW_POST).append('=').append(Base64.encode(blog.getData())).append('/').append(entryId).append('&'); buf.append(PARAM_VISIBLE).append('=').append(Base64.encode(blog.getData())).append('/').append(entryId).append('&'); + } else if (blog != null) { + buf.append(PARAM_AUTHOR).append('=').append(blog.toBase64()).append('&'); } if (tag != null) buf.append(PARAM_TAGS).append('=').append(sanitizeTagParam(tag)).append('&'); 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 f3a3e90525..631bbfc68b 100644 --- a/apps/syndie/java/src/net/i2p/syndie/web/PostServlet.java +++ b/apps/syndie/java/src/net/i2p/syndie/web/PostServlet.java @@ -148,9 +148,7 @@ public class PostServlet extends BaseServlet { writeAuthActionFields(out); out.write("Please confirm that the above is ok"); if (BlogManager.instance().authorizeRemote(user)) { - out.write(", and select what additional archives you want the post transmitted to. "); - out.write("To make changes, hit your browser's back arrow and try again.\n"); - out.write("Remote archive to push this post to: "); + out.write(", and select what additional archive you want the post transmitted to: "); out.write("\n"); + out.write("\n"); + + displayEditForm(user, req, post, out); + out.write("\n"); } @@ -200,37 +202,37 @@ public class PostServlet extends BaseServlet { post.reinitialize(); post.setUser(user); + String parentURI = req.getParameter(PARAM_PARENT); + + String subject = getParam(req, PARAM_SUBJECT); + out.write("
\n"); writeAuthActionFields(out); out.write("\n"); out.write("Post subject: "); out.write("
\n"); - out.write("Post tags: "); - out.write("
\n"); - out.write("Include public names? "); - out.write("
\n"); + + "\" value=\"" + HTMLRenderer.sanitizeTagParam(subject) + "\" />
\n"); out.write("Post content (in raw
SML, no headers):
\n"); out.write("
\n"); out.write("SML post headers:
\n"); out.write("
\n"); - - String parentURI = req.getParameter(PARAM_PARENT); if ( (parentURI != null) && (parentURI.trim().length() > 0) ) out.write("\n"); - out.write(" Tags: \n"); + out.write(" Tags:
\n"); boolean inNewThread = getInNewThread(req); boolean refuseReplies = getRefuseReplies(req); - out.write(" in a new thread? \n"); - out.write(" refuse replies? \n"); + out.write("In a new thread?
\n"); + out.write("Refuse replies?
\n"); + + out.write("Include public names? "); + out.write("
\n"); out.write(ATTACHMENT_FIELDS); @@ -249,9 +251,68 @@ public class PostServlet extends BaseServlet { out.write("
\n"); } + private void displayEditForm(User user, MultiPartRequest req, PostBean post, PrintWriter out) throws IOException { + String parentURI = req.getString(PARAM_PARENT); + + String subject = getParam(req, PARAM_SUBJECT); + + out.write("
\n"); + out.write("
\n"); + writeAuthActionFields(out); + out.write("\n"); + out.write("Post subject: "); + out.write("
\n"); + out.write("Post content (in raw SML, no headers):
\n"); + out.write("
\n"); + out.write("SML post headers:
\n"); + out.write("
\n"); + + if ( (parentURI != null) && (parentURI.trim().length() > 0) ) + out.write("\n"); + + out.write(" Tags:
\n"); + + boolean inNewThread = getInNewThread(req); + boolean refuseReplies = getRefuseReplies(req); + + out.write("In a new thread?
\n"); + out.write("Refuse replies?
\n"); + + out.write("Include public names? "); + out.write("
\n"); + + int newCount = 0; + for (int i = 0; i < 32 && newCount < 3; i++) { + String filename = req.getFilename("entryfile" + i); + if ( (filename != null) && (filename.trim().length() > 0) ) { + out.write("Attachment " + i + ": "); + out.write(HTMLRenderer.sanitizeString(filename)); + out.write("
"); + } else { + out.write("Attachment " + i + ": "); + out.write("
"); + newCount++; + } + } + + out.write("
\n"); + out.write(" "); + out.write("\n"); + + out.write("
\n"); + } + private boolean getInNewThread(HttpServletRequest req) { return getInNewThread(req.getParameter(PARAM_IN_NEW_THREAD)); } + private boolean getInNewThread(MultiPartRequest req) { + return getInNewThread(getParam(req, PARAM_IN_NEW_THREAD)); + } private boolean getInNewThread(String val) { boolean rv = false; String inNewThread = val; @@ -262,6 +323,9 @@ public class PostServlet extends BaseServlet { private boolean getRefuseReplies(HttpServletRequest req) { return getRefuseReplies(req.getParameter(PARAM_REFUSE_REPLIES)); } + private boolean getRefuseReplies(MultiPartRequest req) { + return getRefuseReplies(getParam(req, PARAM_REFUSE_REPLIES)); + } private boolean getRefuseReplies(String val) { boolean rv = false; String refuseReplies = val; @@ -284,6 +348,11 @@ public class PostServlet extends BaseServlet { if (val == null) val = ""; return val; } + private String getParam(MultiPartRequest req, String param) { + String val = req.getString(param); + if (val == null) return ""; + return val; + } private static final String ATTACHMENT_FIELDS = "" + "Attachment 0:
" diff --git a/core/java/src/net/i2p/client/naming/HostsTxtNamingService.java b/core/java/src/net/i2p/client/naming/HostsTxtNamingService.java index 841fb699aa..20a59121e1 100644 --- a/core/java/src/net/i2p/client/naming/HostsTxtNamingService.java +++ b/core/java/src/net/i2p/client/naming/HostsTxtNamingService.java @@ -64,9 +64,9 @@ public class HostsTxtNamingService extends NamingService { try { File f = new File(hostsfile); if ( (f.exists()) && (f.canRead()) ) { - DataHelper.loadProps(hosts, f); + DataHelper.loadProps(hosts, f, true); - String key = hosts.getProperty(hostname); + String key = hosts.getProperty(hostname.toLowerCase()); if ( (key != null) && (key.trim().length() > 0) ) { return lookupBase64(key); } diff --git a/core/java/src/net/i2p/data/DataHelper.java b/core/java/src/net/i2p/data/DataHelper.java index 61415a0b8b..ef5370150b 100644 --- a/core/java/src/net/i2p/data/DataHelper.java +++ b/core/java/src/net/i2p/data/DataHelper.java @@ -212,9 +212,15 @@ public class DataHelper { * */ public static void loadProps(Properties props, File file) throws IOException { - loadProps(props, new FileInputStream(file)); + loadProps(props, file, false); + } + public static void loadProps(Properties props, File file, boolean forceLowerCase) throws IOException { + loadProps(props, new FileInputStream(file), forceLowerCase); } public static void loadProps(Properties props, InputStream inStr) throws IOException { + loadProps(props, inStr, false); + } + public static void loadProps(Properties props, InputStream inStr, boolean forceLowerCase) throws IOException { BufferedReader in = null; try { in = new BufferedReader(new InputStreamReader(inStr, "UTF-8"), 16*1024); @@ -230,7 +236,10 @@ public class DataHelper { String key = line.substring(0, split); String val = line.substring(split+1); if ( (key.length() > 0) && (val.length() > 0) ) - props.setProperty(key, val); + if (forceLowerCase) + props.setProperty(key.toLowerCase(), val); + else + props.setProperty(key, val); } } finally { if (in != null) try { in.close(); } catch (IOException ioe) {} diff --git a/history.txt b/history.txt index 00829366ee..f7432da80f 100644 --- a/history.txt +++ b/history.txt @@ -1,4 +1,18 @@ -$Id: history.txt,v 1.324 2005/11/17 03:23:46 jrandom Exp $ +$Id: history.txt,v 1.325 2005/11/19 23:42:17 jrandom Exp $ + +2005-11-21 jrandom + * IE doesn't strip SPAN from