From 1850e893e94ed3c252244d936516b8d0b26e0890 Mon Sep 17 00:00:00 2001 From: mkvore-commit Date: Mon, 7 Sep 2009 17:33:29 +0000 Subject: [PATCH] removes a bug in SAM v1 and v2 (introduced when merging with v3) --- apps/sam/java/src/net/i2p/sam/SAMHandler.java | 8 +++++--- core/c/jbigi/build.sh | 14 +++++++------- core/c/jcpuid/build.sh | 4 ++-- history.txt | 3 +++ 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/apps/sam/java/src/net/i2p/sam/SAMHandler.java b/apps/sam/java/src/net/i2p/sam/SAMHandler.java index d53a5a662..1bad40f64 100644 --- a/apps/sam/java/src/net/i2p/sam/SAMHandler.java +++ b/apps/sam/java/src/net/i2p/sam/SAMHandler.java @@ -124,9 +124,11 @@ public abstract class SAMHandler implements Runnable { * @return True if the string was successfully written, false otherwise */ protected final boolean writeString(String str) { - if (_log.shouldLog(Log.DEBUG)) - _log.debug("Sending the client: [" + str + "]"); - return writeString(str, socket); + synchronized (socketWLock) { + if (_log.shouldLog(Log.DEBUG)) + _log.debug("Sending the client: [" + str + "]"); + return writeString(str, socket); + } } public static boolean writeString(String str, SocketChannel out) diff --git a/core/c/jbigi/build.sh b/core/c/jbigi/build.sh index 7ef900070..af6dbaa90 100755 --- a/core/c/jbigi/build.sh +++ b/core/c/jbigi/build.sh @@ -15,21 +15,21 @@ mkdir -p lib/ mkdir -p bin/local -VER=4.2.4 +VER=4.3.1 if [ "$1" != "dynamic" -a ! -d gmp-$VER ] then - TAR=gmp-$VER.tar.bz2 + TAR=gmp-$VER.tar.lzma if [ ! -f $TAR ] then - echo "GMP tarball $TAR not found. You must download it from http://gmplib.org/" - exit 1 + echo "Downloading ftp://ftp.gmplib.org/pub/gmp-4.3.1/gmp-4.3.1.tar.lzma" + wget ftp://ftp.gmplib.org/pub/gmp-4.3.1/gmp-4.3.1.tar.lzma fi echo "Building the jbigi library with GMP Version $VER" echo "Extracting GMP..." - tar -xjf gmp-$VER.tar.bz2 + tar -xf gmp-$VER.tar.lzma --lzma fi cd bin/local @@ -42,7 +42,7 @@ then # --with-pic is required for static linking ../../gmp-$VER/configure --with-pic;; *) - ../../gmp-$VER/configure;; + ../../gmp-$VER/configure --with-pic;; esac make sh ../../build_jbigi.sh static @@ -54,7 +54,7 @@ cp *jbigi???* ../../lib/ echo 'Library copied to lib/' cd ../.. -I2P=~/i2p +I2P=~/i2p/i2p if [ ! -f $I2P/lib/i2p.jar ] then echo "I2P installation not found in $I2P - correct \$I2P definition in script to run speed test" diff --git a/core/c/jcpuid/build.sh b/core/c/jcpuid/build.sh index f5c8ea1e1..244eb07b2 100755 --- a/core/c/jcpuid/build.sh +++ b/core/c/jcpuid/build.sh @@ -37,13 +37,13 @@ FreeBSD*) Linux*) COMPILEFLAGS="-fPIC -Wall" INCLUDES="-I. -Iinclude -I$JAVA_HOME/include -I$JAVA_HOME/include/linux" - LINKFLAGS="-shared -static -static-libgcc -Wl,-soname,libjcpuid-x86-linux.so" + LINKFLAGS="-shared -Wl,-soname,libjcpuid-x86-linux.so" LIBFILE="lib/freenet/support/CPUInformation/libjcpuid-x86-linux.so";; esac echo "Compiling C code..." rm -f $LIBFILE -$CC $LINKFLAGS $INCLUDES src/*.c -o $LIBFILE +$CC $COMPILEFLAGS $LINKFLAGS $INCLUDES src/*.c -o $LIBFILE strip $LIBFILE echo Built $LIBFILE diff --git a/history.txt b/history.txt index 048585b51..7731041e5 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,6 @@ +2009-09-07 mkvore + * removes a SAM v1&2 bug + 2009-09-04 zzz * SessionKeyManager, OCMOSJ, Garlic: - Enable per-client SessionKeyManagers for better anonymity