Changeset 032b7d8


Ignore:
Timestamp:
Dec 11, 2011 8:59:26 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
8448001
Parents:
b47dead (diff), 6caa1c3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merge of '0fc24e38cf763d87b57238415416a162be39e1ad'

and 'eb56602a5a6fb7a1d5b54be0a0618c0e861da10f'

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java

    rb47dead r032b7d8  
    4747    private static final String[] SERVER_SKIPHEADERS = {SERVER_HEADER};
    4848    private static final long HEADER_TIMEOUT = 60*1000;
     49    private static final long START_INTERVAL = (60 * 1000) * 3;
     50    private long _startedOn = 0L;
    4951
    5052    private final static byte[] ERR_UNAVAILABLE =
     
    8183        getTunnel().getContext().statManager().createRateStat("i2ptunnel.httpNullWorkaround", "How often an http server works around a streaming lib or i2ptunnel bug", "I2PTunnel.HTTPServer", new long[] { 60*1000, 10*60*1000 });
    8284    }
     85
     86    @Override
     87    public void startRunning() {
     88        super.startRunning();
     89        _startedOn = getTunnel().getContext().clock().now();
     90        // Would be better if this was set when the inbound tunnel becomes alive.
     91    }
     92
    8393
    8494    /**
     
    169179                socket.close();
    170180            } catch (IOException ioe) {}
    171             if (_log.shouldLog(Log.ERROR))
    172                 _log.error("Error connecting to HTTP server " + remoteHost + ':' + remotePort, ex);
     181            // Don't complain too early, Jetty may not be ready.
     182            int level = getTunnel().getContext().clock().now() - _startedOn > START_INTERVAL ? Log.ERROR : Log.WARN;
     183            if (_log.shouldLog(level))
     184                _log.log(level, "Error connecting to HTTP server " + remoteHost + ':' + remotePort, ex);
    173185        } catch (IOException ex) {
    174186            try {
  • build.xml

    rb47dead r032b7d8  
    275275        <exec executable="tr" inputstring="${workspace.changes.jbigi}" outputproperty="workspace.changes.jbigi.tr" errorproperty="mtn.error2" failifexecutionfails="false" >
    276276            <arg value="-s" />
    277             <arg value="[:space:]" />
     277            <arg value="&quot;[:space:]&quot;" />
    278278            <arg value="," />
    279279        </exec>
     
    463463        <exec executable="tr" inputstring="${build.temp}" outputproperty="build.temp.tr" failonerror="true">
    464464            <arg value="-d" />
    465             <arg value="[:space:]"/>
     465            <arg value="&quot;[:space:]&quot;"/>
    466466        </exec>
    467467        <exec executable="cut" inputstring="${build.temp.tr}" outputproperty="build.number" failonerror="true" >
  • core/c/jbigi/mbuild-all.sh

    rb47dead r032b7d8  
    1 #!/usr/bin/env bash
    2 
    3 if [ -z "$BASH_VERSION" ]; then
    4         echo "This script needs to be run with Bash."
    5         echo
    6         echo "Please install bash and then run this script with"
    7         echo "bash $0"
    8         exit 1
    9 fi
     1#!/bin/sh
    102
    113#FIXME What platforms for MacOS?
     
    5042# You should not need to edit anything below this comment.
    5143#
     44
     45# The built-in echo in /bin/sh (the real bourne shell) on BSD systems supports -e.
     46# The built-in echo in dash (the default /bin/sh on Debian) does not support -e
     47# but /bin/echo always supports -e in Linux; therefore, let's set echo to /bin/echo
     48# whenever we're on Linux and use the shell's built-in "echo" on everything else.
     49
     50if [ $(uname -s |tr "[A-Z]" "[a-z]") = "linux" ]; then
     51        ECHO="/bin/echo"
     52else
     53        ECHO="echo"
     54fi
    5255
    5356MINGW_PLATFORMS="${X86_PLATFORMS} ${MISC_MINGW_PLATFORMS}"
     
    6164DARWIN_PLATFORMS="core2 corei"
    6265
    63 # Set the version to 5.0.2 for OSX because
    64 # 1) it doesn't have the -r parameter as an option for sed
    65 # 2) AFAIK there are only 64bit capable CPUs for the Intel Macs
     66# Set the version to 5.0.2 for OSX because AFAIK there are only 64bit capable CPUs for the Intel Macs
    6667if [ `uname -s |grep Darwin` ]; then
    67         VER=5.0.2
     68        VER=5.0.2
    6869else
    69         VER=$(echo gmp-*.tar.bz2 | sed -re "s/(.*-)(.*)(.*.tar.bz2)$/\2/" | tail -n 1)
     70        VER=$($ECHO gmp-*.tar.bz2 | sed -e "s/\(.*-\)\(.*\)\(.*.tar.bz2\)$/\2/" | tail -n 1)
    7071fi
    7172
    7273if [ "$VER" = "" ] ; then
    73         echo "ERROR! Can't find gmp source tarball."
    74         exit 1
    75 fi
    76 
    77 
    78 case `uname -sr` in
     74        $ECHO "ERROR! Can't find gmp source tarball."
     75        exit 1
     76fi
     77
     78
     79case `uname -s` in
    7980MINGW*)
    80         PLATFORM_LIST="${MINGW_PLATFORMS}"
    81         NAME="jbigi"
    82         TYPE="dll"
    83         TARGET="-windows-"
    84         echo "Building windows .dlls for all architectures";;
     81        PLATFORM_LIST="${MINGW_PLATFORMS}"
     82        NAME="jbigi"
     83        TYPE="dll"
     84        TARGET="-windows-"
     85        $ECHO "Building windows .dlls for all architectures";;
    8586Darwin*)
    86         PLATFORM_LIST="${DARWIN_PLATFORMS}"
    87         NAME="libjbigi"
    88         TYPE="jnilib"
    89         TARGET="-osx-"
    90         echo "Building ${TARGET} .jnilibs for all architectures";;
     87        PLATFORM_LIST="${DARWIN_PLATFORMS}"
     88        NAME="libjbigi"
     89        TYPE="jnilib"
     90        TARGET="-osx-"
     91        $ECHO "Building ${TARGET} .jnilibs for all architectures";;
    9192Linux*)
    92         NAME="libjbigi"
    93         TYPE="so"
    94         PLATFORM_LIST=""
    95         TARGET="-linux-"
    96         arch=$(uname -m | cut -f1 -d" ")
    97         case ${arch} in
    98                 i[3-6]86)
    99                         arch="x86";;
    100         esac
    101         case ${arch} in
    102                 x86_64 | amd64)
    103                         PLATFORM_LIST="${X86_64_PLATFORMS}"
    104                         TARGET="-linux-X86_64-";;
    105                 ia64)
    106                         PLATFORM_LIST="${X86_64_PLATFORMS}"
    107                         TARGET="-linux-ia64-";;
    108                 x86)
    109                         PLATFORM_LIST="${X86_PLATFORMS}"
    110                         TARGET="-linux-x86-";;
    111                 *)
    112                         PLATFORM_LIST="${LINUX_PLATFORMS}";;
    113         esac
    114         echo "Building ${TARGET} .so's for ${arch}";;
     93        NAME="libjbigi"
     94        TYPE="so"
     95        PLATFORM_LIST=""
     96        TARGET="-linux-"
     97        arch=$(uname -m | cut -f1 -d" ")
     98        case ${arch} in
     99                i[3-6]86)
     100                        arch="x86";;
     101        esac
     102        case ${arch} in
     103                x86_64 | amd64)
     104                        PLATFORM_LIST="${X86_64_PLATFORMS}"
     105                        TARGET="-linux-X86_64-";;
     106                ia64)
     107                        PLATFORM_LIST="${X86_64_PLATFORMS}"
     108                        TARGET="-linux-ia64-";;
     109                x86)
     110                        PLATFORM_LIST="${X86_PLATFORMS}"
     111                        TARGET="-linux-x86-";;
     112                *)
     113                        PLATFORM_LIST="${LINUX_PLATFORMS}";;
     114        esac
     115        $ECHO "Building ${TARGET} .sos for ${arch}";;
    115116NetBSD*|FreeBSD*|OpenBSD*)
    116         NAME="libjbigi"
    117         TYPE="so"
    118         PLATFORM_LIST=""
    119         BSDTYPE="`uname -s | tr [A-Z] [a-z]`"
    120         arch=$(uname -m | cut -f1 -d" ")
    121         case ${arch} in
    122                 i[3-6]86)
    123                         arch="x86";;
    124         esac
    125         case ${arch} in
    126                 x86_64|amd64)
    127                         PLATFORM_LIST="${X86_64_PLATFORMS}"
    128                         TARGET="-${BSDTYPE}-X86_64-";;
    129                 ia64)
    130                         PLATFORM_LIST="${X86_64_PLATFORMS}"
    131                         TARGET="-${BSDTYPE}-ia64-";;
    132                 x86)
    133                         PLATFORM_LIST="${X86_PLATFORMS}"
    134                         TARGET="-${BSDTYPE}-x86-";;
    135                 *)
    136                         case ${BSDTYPE} in
    137                                 netbsd)
    138                                         PLATFORM_LIST="${NETBSD_PLATFORMS}";;
    139                                 openbsd)
    140                                         PLATFORM_LIST="${OPENBSD_PLATFORMS}";;
    141                                 freebsd)
    142                                         PLATFORM_LIST="${FREEBSD_PLATFORMS}";;
    143                                 *)
    144                                         echo "Unsupported build environment"
    145                                         exit 1;;
    146                         esac
    147         esac
    148         echo "Building ${BSDTYPE} .so's for ${arch}";;
     117        NAME="libjbigi"
     118        TYPE="so"
     119        PLATFORM_LIST=""
     120        BSDTYPE=$(uname -s | tr "[A-Z]" "[a-z]")
     121        arch=$(uname -m | cut -f1 -d" ")
     122        case ${arch} in
     123                i[3-6]86)
     124                        arch="x86";;
     125        esac
     126        case ${arch} in
     127                x86_64|amd64)
     128                        PLATFORM_LIST="${X86_64_PLATFORMS}"
     129                        TARGET="-${BSDTYPE}-X86_64-";;
     130                ia64)
     131                        PLATFORM_LIST="${X86_64_PLATFORMS}"
     132                        TARGET="-${BSDTYPE}-ia64-";;
     133                x86)
     134                        PLATFORM_LIST="${X86_PLATFORMS}"
     135                        TARGET="-${BSDTYPE}-x86-";;
     136                *)
     137                        case ${BSDTYPE} in
     138                                netbsd)
     139                                        PLATFORM_LIST="${NETBSD_PLATFORMS}";;
     140                                openbsd)
     141                                        PLATFORM_LIST="${OPENBSD_PLATFORMS}";;
     142                                freebsd)
     143                                        PLATFORM_LIST="${FREEBSD_PLATFORMS}";;
     144                                *)
     145                                        $ECHO "Unsupported build environment"
     146                                        exit 1;;
     147                        esac
     148        esac
     149        $ECHO "Building ${BSDTYPE} .sos for ${arch}";;
    149150*)
    150         echo "Unsupported build environment"
    151         exit;;
     151        $ECHO "Unsupported build environment"
     152        exit;;
    152153esac
    153154
    154 function make_static {
    155         echo "Attempting .${4} creation for ${3}${5}${2}"
    156         ../../mbuild_jbigi.sh static || return 1
    157         cp ${3}.${4} ../../lib/net/i2p/util/${3}${5}${2}.${4}
    158         return 0
    159 }
    160 
    161 function make_file {
    162         # Nonfatal bail out on Failed build.
    163         echo "Attempting build for ${3}${5}${2}"
    164         make && return 0
    165         cd ..
    166         rm -R "$2"
    167         echo -e "\n\nFAILED! ${3}${5}${2} not made.\a"
    168         sleep 10
    169         return 1
    170 }
    171 
    172 function configure_file {
    173         echo -e "\n\n\nAttempting configure for ${3}${5}${2}\n\n\n"
    174         sleep 10
    175         # Nonfatal bail out on unsupported platform.
    176         if [ `uname -s |grep Darwin` ]; then
    177                 ../../gmp-${1}/configure --build=${2}-apple-darwin --with-pic && return 0
    178         else
    179                 ../../gmp-${1}/configure --build=${2} --with-pic && return 0
    180         fi
    181         cd ..
    182         rm -R "$2"
    183         echo -e "\n\nSorry, ${3}${5}${2} is not supported on your build environment.\a"
    184         sleep 10
    185         return 1
    186 }
    187 
    188 function build_file {
    189         configure_file "$1" "$2" "$3" "$4" "$5"  && make_file "$1" "$2" "$3" "$4" "$5" && make_static "$1" "$2" "$3" "$4" "$5" && return 0
    190         echo -e "\n\n\nError building static!\n\n\a"
    191         sleep 10
    192         return 1
    193 }
    194 
    195 echo "Extracting GMP Version $VER ..."
    196 tar -xjf gmp-$VER.tar.bz2 || ( echo "Error in tarball file!" ; exit 1 )
     155make_static () {
     156        $ECHO "Attempting .${4} creation for ${3}${5}${2}"
     157        ../../mbuild_jbigi.sh static || return 1
     158        cp ${3}.${4} ../../lib/net/i2p/util/${3}${5}${2}.${4}
     159        return 0
     160}
     161
     162make_file () {
     163        # Nonfatal bail out on Failed build.
     164        $ECHO "Attempting build for ${3}${5}${2}"
     165        make && return 0
     166        cd ..
     167        rm -R "$2"
     168        $ECHO -e "\n\nFAILED! ${3}${5}${2} not made.\a"
     169        sleep 10
     170        return 1
     171}
     172
     173configure_file () {
     174        $ECHO -e "\n\n\nAttempting configure for ${3}${5}${2}\n\n\n"
     175        sleep 10
     176        # Nonfatal bail out on unsupported platform.
     177        if [ `uname -s |grep Darwin` ]; then
     178                ../../gmp-${1}/configure --build=${2}-apple-darwin --with-pic && return 0
     179        else
     180                ../../gmp-${1}/configure --build=${2} --with-pic && return 0
     181        fi
     182        cd ..
     183        rm -R "$2"
     184        $ECHO -e "\n\nSorry, ${3}${5}${2} is not supported on your build environment.\a"
     185        sleep 10
     186        return 1
     187}
     188
     189build_file () {
     190        configure_file "$1" "$2" "$3" "$4" "$5"  && make_file "$1" "$2" "$3" "$4" "$5" && make_static "$1" "$2" "$3" "$4" "$5" && return 0
     191        $ECHO -e "\n\n\nError building static!\n\n\a"
     192        sleep 10
     193        return 1
     194}
     195
     196$ECHO "Extracting GMP Version $VER ..."
     197tar -xjf gmp-$VER.tar.bz2 || ( $ECHO "Error in tarball file!" ; exit 1 )
    197198
    198199if [ ! -d bin ]; then
    199         mkdir bin
     200        mkdir bin
    200201fi
    201202if [ ! -d lib/net/i2p/util ]; then
    202         mkdir -p lib/net/i2p/util
     203        mkdir -p lib/net/i2p/util
    203204fi
    204205
     
    208209for x in $NO_PLATFORM $PLATFORM_LIST
    209210do
    210         (
    211                 if [ ! -d bin/$x ]; then
    212                         mkdir bin/$x
    213                         cd bin/$x
    214                 else
    215                         cd bin/$x
    216                         rm -Rf *
    217                 fi
    218 
    219                 build_file "$VER" "$x" "$NAME" "$TYPE" "$TARGET"
    220         )
     211        (
     212                if [ ! -d bin/$x ]; then
     213                        mkdir bin/$x
     214                        cd bin/$x
     215                else
     216                        cd bin/$x
     217                        rm -Rf *
     218                fi
     219
     220                build_file "$VER" "$x" "$NAME" "$TYPE" "$TARGET"
     221        )
    221222done
    222223
    223 echo "Success!"
     224$ECHO "Success!"
    224225exit 0
  • core/c/jbigi/mbuild_jbigi.sh

    rb47dead r032b7d8  
    1 #!/usr/bin/env bash
     1#!/bin/sh
    22# When executed in Mingw: Produces a jbigi.dll
    33# When executed in Linux/FreeBSD: Produces a libjbigi.so
     
    55CC="gcc"
    66
    7 case `uname -sr` in
     7case `uname -s` in
    88MINGW*)
    9         JAVA_HOME="c:/software/j2sdk1.4.2_05"
    10         COMPILEFLAGS="-Wall"
    11         INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include/win32/ -I$JAVA_HOME/include/"
    12         LINKFLAGS="-shared -Wl,--kill-at"
    13         LIBFILE="jbigi.dll";;
     9        JAVA_HOME="c:/software/j2sdk1.4.2_05"
     10        COMPILEFLAGS="-Wall"
     11        INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include/win32/ -I$JAVA_HOME/include/"
     12        LINKFLAGS="-shared -Wl,--kill-at"
     13        LIBFILE="jbigi.dll";;
    1414CYGWIN*)
    15         JAVA_HOME="c:/software/j2sdk1.4.2_05"
    16         COMPILEFLAGS="-Wall -mno-cygwin"
    17         INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include/win32/ -I$JAVA_HOME/include/"
    18         LINKFLAGS="-shared -Wl,--kill-at"
    19         LIBFILE="jbigi.dll";;
     15        JAVA_HOME="c:/software/j2sdk1.4.2_05"
     16        COMPILEFLAGS="-Wall -mno-cygwin"
     17        INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include/win32/ -I$JAVA_HOME/include/"
     18        LINKFLAGS="-shared -Wl,--kill-at"
     19        LIBFILE="jbigi.dll";;
    2020Darwin*)
    21         JAVA_HOME=$(/usr/libexec/java_home)
     21        JAVA_HOME=$(/usr/libexec/java_home)
    2222        COMPILEFLAGS="-fPIC -Wall"
    2323        INCLUDES="-I. -I../../jbigi/include -I$JAVA_HOME/include"
     
    2525        LIBFILE="libjbigi.jnilib";;
    2626SunOS*|OpenBSD*|NetBSD*|FreeBSD*|Linux*)
    27         UNIXTYPE="`uname -s | tr [A-Z] [a-z]`"
     27        UNIXTYPE=$(uname -s | tr "[A-Z]" "[a-z]")
    2828        if [ $UNIXTYPE = "sunos" ]; then
    2929                UNIXTYPE="solaris"
     
    3838                        JAVA_HOME="/usr/local/jdk-1.7.0"
    3939                fi
    40         elif [ $UNIXTYPE = "netbsd" ]; then
    41                 if [ -d /usr/pkg/java/openjdk7 ]; then
    42                         JAVA_HOME="/usr/pkg/java/openjdk7"
    43                 fi
    44         elif [ $UNIXTYPE = "linux" -a -e /etc/debian_version ]; then
    45                 if [ -d /usr/lib/jvm/default-java ]; then
    46                         JAVA_HOME="/usr/lib/jvm/default-java"
    47                 fi
     40        elif [ $UNIXTYPE = "netbsd" ]; then
     41                if [ -d /usr/pkg/java/openjdk7 ]; then
     42                        JAVA_HOME="/usr/pkg/java/openjdk7"
     43                fi
     44        elif [ $UNIXTYPE = "linux" ] && [ -e /etc/debian_version ]; then
     45                if [ -d /usr/lib/jvm/default-java ]; then
     46                        JAVA_HOME="/usr/lib/jvm/default-java"
     47                fi
    4848        fi
    4949        COMPILEFLAGS="-fPIC -Wall"
     
    5252        LIBFILE="libjbigi.so";;
    5353*)
    54         echo "Unsupported system type."
    55         exit 1;;
     54        echo "Unsupported system type."
     55        exit 1;;
    5656esac
    5757
    5858if [ "$1" = "dynamic" ] ; then
    59         echo "Building a jbigi lib that is dynamically linked to GMP"
    60         LIBPATH="-L.libs"
    61         INCLUDELIBS="-lgmp"
     59        echo "Building a jbigi lib that is dynamically linked to GMP"
     60        LIBPATH="-L.libs"
     61        INCLUDELIBS="-lgmp"
    6262else
    63         echo "Building a jbigi lib that is statically linked to GMP"
    64         STATICLIBS=".libs/libgmp.a"
     63        echo "Building a jbigi lib that is statically linked to GMP"
     64        STATICLIBS=".libs/libgmp.a"
    6565fi
    6666
  • history.txt

    rb47dead r032b7d8  
     12011-12-11 sponge
     2  * HTTP server tunnel, use log.WARN for 3 first minutes. (closes #460)
     3
    142011-12-10 kytv
    25  * Replace eepget's whitelist of accepted characters with the
Note: See TracChangeset for help on using the changeset viewer.