From 23f782a5ddf70c894e641943193e347bd99ac0e0 Mon Sep 17 00:00:00 2001 From: oakes Date: Wed, 26 Feb 2014 17:44:49 -0500 Subject: [PATCH 1/2] Increment version number --- android/AndroidManifest.xml | 2 +- android/project.clj | 8 ++++---- desktop/project.clj | 8 ++++---- server/project.clj | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 765d807..8004d74 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="net.nightweb" android:versionCode="26" android:versionName="0.0.26"> diff --git a/android/project.clj b/android/project.clj index 1122971..99b7935 100644 --- a/android/project.clj +++ b/android/project.clj @@ -1,4 +1,4 @@ -(defproject nightweb-android/Nightweb "0.0.25" +(defproject nightweb-android/Nightweb "0.0.26" :license {:name "Public Domain" :url "http://unlicense.org/UNLICENSE"} :min-lein-version "2.0.0" @@ -9,10 +9,10 @@ :java-source-paths ["src/java" "../common/java" "gen"] :javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"] - :dependencies [[com.h2database/h2 "1.3.174"] + :dependencies [[com.h2database/h2 "1.3.175"] [markdown-clj "0.9.36"] - [neko/neko "3.0.0"] - [org.clojure/java.jdbc "0.3.2"] + [neko/neko "3.0.1"] + [org.clojure/java.jdbc "0.3.3"] [org.clojure-android/clojure "1.5.1-jb" :use-resources true]] :profiles {:dev {:dependencies [[android/tools.nrepl "0.2.0-bigstack"]] :android {:aot :all-with-unused}} diff --git a/desktop/project.clj b/desktop/project.clj index f524668..4fd89f9 100644 --- a/desktop/project.clj +++ b/desktop/project.clj @@ -1,12 +1,12 @@ -(defproject nightweb-desktop "0.0.25" +(defproject nightweb-desktop "0.0.26" :license {:name "Public Domain" :url "http://unlicense.org/UNLICENSE"} :dependencies [[com.github.insubstantial/substance "7.2.1"] - [com.h2database/h2 "1.3.174"] - [hiccup "1.0.4"] + [com.h2database/h2 "1.3.175"] + [hiccup "1.0.5"] [markdown-clj "0.9.36"] [org.clojure/clojure "1.5.1"] - [org.clojure/java.jdbc "0.3.2"] + [org.clojure/java.jdbc "0.3.3"] [ring "1.2.1"] [seesaw "1.4.4"]] :source-paths ["src" "../common/clojure"] diff --git a/server/project.clj b/server/project.clj index 88e729a..27e1b6f 100644 --- a/server/project.clj +++ b/server/project.clj @@ -1,9 +1,9 @@ -(defproject nightweb-server/Nightweb "0.0.25" +(defproject nightweb-server/Nightweb "0.0.26" :license {:name "Public Domain" :url "http://unlicense.org/UNLICENSE"} :dependencies [[org.clojure/clojure "1.5.1"] - [org.clojure/java.jdbc "0.3.2"] - [com.h2database/h2 "1.3.174"]] + [org.clojure/java.jdbc "0.3.3"] + [com.h2database/h2 "1.3.175"]] :source-paths ["src" "../common/clojure"] :java-source-paths ["../common/java"] :aot [nightweb-server.core] From 698512da7fd41ad5cd3688c850a8b7ab131fb6f0 Mon Sep 17 00:00:00 2001 From: isaric Date: Wed, 28 Jan 2015 12:03:23 +0100 Subject: [PATCH 2/2] Update I2NPMessageImpl.java I have set the _uniqueId field in the constructor to equal -1 as per instructions on OpenHatch. Added a new method setRandomID which generates a random number using the same method as before and passes it to setUniqueID. The code is located just below the setUniqueID method. --- .../java/router/net/i2p/data/i2np/I2NPMessageImpl.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/java/router/net/i2p/data/i2np/I2NPMessageImpl.java b/common/java/router/net/i2p/data/i2np/I2NPMessageImpl.java index f3add3c..c63149d 100644 --- a/common/java/router/net/i2p/data/i2np/I2NPMessageImpl.java +++ b/common/java/router/net/i2p/data/i2np/I2NPMessageImpl.java @@ -64,7 +64,7 @@ public I2NPMessageImpl(I2PAppContext context) { _log = context.logManager().getLog(I2NPMessageImpl.class); _expiration = _context.clock().now() + DEFAULT_EXPIRATION_MS; // FIXME/TODO set only for outbound, or only on write, or something, to not waste entropy - _uniqueId = _context.random().nextLong(MAX_ID_VALUE); + _uniqueId = -1; //_context.statManager().createRateStat("i2np.writeTime", "How long it takes to write an I2NP message", "I2NP", new long[] { 10*60*1000, 60*60*1000 }); //_context.statManager().createRateStat("i2np.readTime", "How long it takes to read an I2NP message", "I2NP", new long[] { 10*60*1000, 60*60*1000 }); } @@ -254,7 +254,7 @@ public void writeBytes(OutputStream out) throws DataFormatException, IOException public long getUniqueId() { return _uniqueId; } /** - * The ID is set to a random value in the constructor but it can be overridden here. + * The ID is set to -1 in the constructor. This will throw an error unless another ID is entered. */ public void setUniqueId(long id) { _uniqueId = id; } @@ -262,6 +262,11 @@ public void writeBytes(OutputStream out) throws DataFormatException, IOException * Date after which the message should be dropped (and the associated uniqueId forgotten) * */ + public void setRandomId(){setUniqueId(_context.random().nextLong(MAX_ID_VALUE));} + /** + * Generates a random number and passes it to setUniqueID. + * / + public long getMessageExpiration() { return _expiration; } /**