From 573692dbdfe425b14c9850b86e104d2886ecb4de Mon Sep 17 00:00:00 2001 From: zzz Date: Tue, 29 Jan 2013 13:48:00 +0000 Subject: [PATCH] * Console: Catch IllegalStateException storing nonces (ticket #852) --- apps/routerconsole/jsp/formhandler.jsi | 19 ++++++++++++++----- history.txt | 6 ++++++ .../src/net/i2p/router/RouterVersion.java | 2 +- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/apps/routerconsole/jsp/formhandler.jsi b/apps/routerconsole/jsp/formhandler.jsi index dc8c65b30..e00bf6f43 100644 --- a/apps/routerconsole/jsp/formhandler.jsi +++ b/apps/routerconsole/jsp/formhandler.jsi @@ -19,9 +19,15 @@ String klass = formhandler.getClass().getName(); String nonceAttr1 = klass + ".nonce"; String nonceAttr2 = nonceAttr1 + "Prev"; - String nonce1 = (String) session.getAttribute(nonceAttr1); - String nonce2 = (String) session.getAttribute(nonceAttr2); - formhandler.storeNonces(nonce1, nonce2); + String nonce1 = null; + try { + // Jetty doesn't seem to ISE here... + nonce1 = (String) session.getAttribute(nonceAttr1); + String nonce2 = (String) session.getAttribute(nonceAttr2); + formhandler.storeNonces(nonce1, nonce2); + } catch (IllegalStateException ise) { + // nonce1 will be null, removed in setAttibute below + } // Put all the params in the map, some handlers use this instead of individual setters // We also call all of the setters below. @@ -37,7 +43,10 @@ // This shuffles down the nonces, so it must be after getAllMessages() above, // since it does the form validation. String pageNonce = formhandler.getNewNonce(); - session.setAttribute(nonceAttr2, nonce1); - session.setAttribute(nonceAttr1, pageNonce); + try { + // Jetty waits to ISE until here.... + session.setAttribute(nonceAttr2, nonce1); + session.setAttribute(nonceAttr1, pageNonce); + } catch (IllegalStateException ise) {} %> diff --git a/history.txt b/history.txt index 3804b129c..3169c9161 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,9 @@ +2013-01-29 zzz + * Console: Catch IllegalStateException storing nonces (ticket #852) + * Translations: + - Use JVM language name if available + - Correct Estonian language code from ee to et + 2013-01-27 zzz * BuildHandler: - Add early throttler based on previous hop diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index fecba78d6..a6204817e 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 7; + public final static long BUILD = 8; /** for example "-test" */ public final static String EXTRA = "";