diff --git a/Slackware/i2p-base/i2p-base.SlackBuild b/Slackware/i2p-base/i2p-base.SlackBuild
index 1a5a254dc..5b44e63ef 100644
--- a/Slackware/i2p-base/i2p-base.SlackBuild
+++ b/Slackware/i2p-base/i2p-base.SlackBuild
@@ -21,7 +21,7 @@ CWD=$(pwd)
TMP=/tmp
PKG=/$TMP/package-base-i2p
NAME=i2p-base
-VERSION=0.0.3
+VERSION=0.0.4
BUILD=1sponge
ARCH=noarch
INSTALL_DIR=opt
diff --git a/Slackware/i2p-base/rc.i2p_def b/Slackware/i2p-base/rc.i2p_def
index c231922e5..ef96415ba 100644
--- a/Slackware/i2p-base/rc.i2p_def
+++ b/Slackware/i2p-base/rc.i2p_def
@@ -3,7 +3,7 @@
i2p_start() {
# Check if router is up first!
- /bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory status )" > /dev/null
+ /bin/su - -c "/bin/bash -l -c '( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\" ; directory status )'" > /dev/null
if [ $? -eq 0 ] ; then {
# I2p is already running, so tell the user.
echo "I2P is already running..."
@@ -14,13 +14,13 @@ i2p_start() {
# Just in-case there are leftover junk in /tmp...
rm -Rf `grep /tmp/hsperfdata_root/* -le i2p` /tmp/i2p-*.tmp /tmp/router.ping
# Now that all junk is cleaned up, start.
- /bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory start )"
+ /bin/su - -c "/bin/bash -l -c '( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\" ; directory start )'"
}
fi
}
i2p_stop() {
- /bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory stop )"
+ /bin/su - -c "/bin/bash -l -c '( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\" ; directory stop )'"
rm -Rf `grep /tmp/hsperfdata_root/* -le i2p` /tmp/i2p-*.tmp /tmp/router.ping
}
@@ -31,15 +31,15 @@ i2p_restart() {
}
i2p_status() {
- /bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory status )"
+ /bin/su - -c "/bin/bash -l -c '( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\" ; directory status )'"
}
i2p_console() {
- /bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory console )"
+ /bin/su - -c "/bin/bash -l -c '( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\" ; directory console )'"
}
i2p_dump() {
- /bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory dump )"
+ /bin/su - -c "/bin/bash -l -c '( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\" ; directory dump )'"
}
case "$1" in
diff --git a/apps/i2psnark/java/src/org/klomp/snark/PartialPiece.java b/apps/i2psnark/java/src/org/klomp/snark/PartialPiece.java
index e810edc29..3a7154899 100644
--- a/apps/i2psnark/java/src/org/klomp/snark/PartialPiece.java
+++ b/apps/i2psnark/java/src/org/klomp/snark/PartialPiece.java
@@ -7,6 +7,8 @@ package org.klomp.snark;
* It is also passed from PeerState to PeerCoordinator when
* a piece is not completely downloaded, for example
* when the Peer disconnects or chokes.
+ *
+ * @since 0.8.2
*/
class PartialPiece implements Comparable {
diff --git a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java
index d74426ee1..a570de2d0 100644
--- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java
+++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java
@@ -329,14 +329,18 @@ public class I2PSnarkServlet extends Default {
// Opera and text-mode browsers: no and no input type=image values submitted
String ua = req.getHeader("User-Agent");
- boolean isDegraded = ua != null && (ua.startsWith("Opera") || ua.startsWith("Lynx") ||
+ boolean isDegraded = ua != null && (ua.startsWith("Lynx") ||
ua.startsWith("ELinks") || ua.startsWith("Dillo"));
+ boolean noThinsp = isDegraded || ua.startsWith("Opera");
if (_manager.util().connected()) {
if (isDegraded)
out.write(" 0 && !showPeers)
statusString = "
ISO_8859_1 encoding is used by default for % encoded characters. This
+ * may be overridden with the org.mortbay.util.URI.charset system property.
+ * @see UrlEncoded
+ * @version $Id: URI.java,v 1.40 2009/05/16 02:02:00 gregwilkins Exp $
+ * @author Greg Wilkins (gregw)
+ */
+public class URI
+ implements Cloneable
+{
+ private static Log log = LogFactory.getLog(URI.class);
+
+ public static final String __CHARSET=System.getProperty("org.mortbay.util.URI.charset",StringUtil.__UTF_8);
+ public static final boolean __CHARSET_IS_DEFAULT=__CHARSET.equals(StringUtil.__UTF_8);
+
+ /* ------------------------------------------------------------ */
+ private String _uri;
+ private String _scheme;
+ private String _host;
+ private int _port;
+ private String _path;
+ private String _encodedPath;
+ private String _query;
+ private UrlEncoded _parameters;
+ private boolean _dirty;
+ private static String unreserved = "/0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.~";
+ private static String reserved = "!*'();:@&=+$,?%#[]";
+ private static String hexchars = "0123456789ABCDEF";
+
+ /* ------------------------------------------------------------ */
+ /** Copy Constructor .
+ * @param uri
+ */
+ public URI(URI uri)
+ throws IllegalArgumentException
+ {
+ _uri=uri.toString();
+ _scheme=uri._scheme;
+ _host=uri._host;
+ _port=uri._port;
+ _path=uri._path;
+ _encodedPath=uri._encodedPath;
+ _query=uri._query;
+ if (uri._parameters!=null)
+ _parameters=(UrlEncoded)uri._parameters.clone();
+ _dirty=false;
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Construct from a String.
+ * The string must contain a URI path, but optionaly may contain a
+ * scheme, host, port and query string.
+ *
+ * @param uri [scheme://host[:port]]/path[?query]
+ */
+ public URI(String uri)
+ throws IllegalArgumentException
+ {
+ setURI(uri);
+ }
+
+ /* ------------------------------------------------------------ */
+ public void setURI(String uri)
+ throws IllegalArgumentException
+ {
+ try
+ {
+ _uri=uri;
+ _scheme=null;
+ _host=null;
+ _port=0;
+ _path=null;
+ _encodedPath=null;
+ _query=null;
+ if (_parameters!=null)
+ _parameters.clear();
+
+ // Scan _uri for host, port, path & query
+ int maxi=uri.length()-1;
+ int mark=0;
+ int state=0;
+ int i=0;
+
+ if (maxi==0 || uri.charAt(0)=='/' && uri.charAt(1)!='/')
+ {
+ state=3;
+ _scheme=null;
+ _host=null;
+ _port=0;
+ }
+ else
+ {
+ for (i=0;state<3 && i<=maxi;i++)
+ {
+ char c=uri.charAt(i);
+ switch(state)
+ {
+ case 0: // looking for scheme or path
+ if (c==':' &&
+ uri.charAt(i+1)=='/' &&
+ uri.charAt(i+2)=='/')
+ {
+ // found end of scheme & start of host
+ _scheme=uri.substring(mark,i);
+ i+=2;
+ mark=i+1;
+ state=1;
+ }
+ else if (i==0 && c=='/')
+ {
+ // Found path
+ state=3;
+ }
+ else if (i==0 && c=='*')
+ {
+ state=5;
+ _path="*";
+ _encodedPath="*";
+ }
+ continue;
+
+ case 1: // Get host & look for port or path
+ if (c==':')
+ {
+ // found port
+ _host=uri.substring(mark,i);
+ mark=i+1;
+ state=2;
+ }
+ else if (c=='/')
+ {
+ // found path
+ _host=uri.substring(mark,i);
+ mark=i;
+ state=3;
+ }
+ continue;
+
+ case 2: // Get port & look for path
+ if (c=='/')
+ {
+ _port=TypeUtil.parseInt(uri,mark,i-mark,10);
+ mark=i;
+ state=3;
+ }
+ continue;
+ }
+ }
+ }
+
+ // State 3 - Get path & look for query
+ _query=null;
+ for (i++;i<=maxi;i++)
+ {
+ char c=uri.charAt(i);
+ if (c=='?')
+ {
+ // Found query
+ _encodedPath=uri.substring(mark,i);
+ _path=decodePath(_encodedPath);
+
+ mark=i+1;
+ state=4;
+ break;
+ }
+ }
+
+ // complete last state
+ switch(state)
+ {
+ case 0:
+ _dirty=false;
+ _encodedPath=_uri;
+ _path=decodePath(_encodedPath);
+ break;
+
+ case 1:
+ _dirty=true;
+ _encodedPath="/";
+ _path=_encodedPath;
+ _host=uri.substring(mark);
+ break;
+
+ case 2:
+ _dirty=true;
+ _encodedPath="/";
+ _path=_encodedPath;
+ _port=TypeUtil.parseInt(uri,mark,-1,10);
+ break;
+ case 3:
+ _dirty=(mark==maxi);
+ _encodedPath=uri.substring(mark);
+ _path=decodePath(_encodedPath);
+ break;
+
+ case 4:
+ _dirty=false;
+ if (mark<=maxi)
+ _query=uri.substring(mark);
+ break;
+
+ case 5:
+ _dirty=false;
+ }
+
+ if (_query!=null && _query.length()>0)
+ {
+ if (_parameters==null)
+ _parameters= new UrlEncoded();
+ else
+ _parameters.clear();
+ _parameters.decode(_query,__CHARSET);
+
+ }
+ else
+ _query=null;
+ }
+ catch (Exception e)
+ {
+ LogSupport.ignore(log,e);
+ throw new IllegalArgumentException("Malformed URI '"+uri+
+ "' : "+e.toString());
+ }
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Is the URI an absolute URL?
+ * @return True if the URI has a scheme or host
+ */
+ public boolean isAbsolute()
+ {
+ return _scheme!=null || _host!=null;
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Get the uri scheme.
+ * @return the URI scheme
+ */
+ public String getScheme()
+ {
+ return _scheme;
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Set the uri scheme.
+ * @param scheme the uri scheme
+ */
+ public void setScheme(String scheme)
+ {
+ _scheme=scheme;
+ _dirty=true;
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Get the uri host.
+ * @return the URI host
+ */
+ public String getHost()
+ {
+ return _host;
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Set the uri host.
+ * @param host the uri host
+ */
+ public void setHost(String host)
+ {
+ _host=host;
+ _dirty=true;
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Get the uri port.
+ * @return the URI port
+ */
+ public int getPort()
+ {
+ return _port;
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Set the uri port.
+ * A port of 0 implies use the default port.
+ * @param port the uri port
+ */
+ public void setPort(int port)
+ {
+ _port=port;
+ _dirty=true;
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Get the uri path.
+ * @return the URI path
+ */
+ public String getPath()
+ {
+ return _path;
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Get the encoded uri path.
+ * @return the URI path
+ */
+ public String getEncodedPath()
+ {
+ return _encodedPath;
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Set the uri path.
+ * @param path the URI path
+ */
+ public void setPath(String path)
+ {
+ _path=path;
+ _encodedPath=encodePath(_path);
+ _dirty=true;
+ }
+
+
+ /* ------------------------------------------------------------ */
+ /** Get the uri query String.
+ * @return the URI query string
+ */
+ public String getQuery()
+ {
+ if (_dirty && _parameters!=null)
+ {
+ _query = _parameters.encode(__CHARSET);
+ if (_query!=null && _query.length()==0)
+ _query=null;
+ }
+ return _query;
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Set the uri query String.
+ * @param query the URI query string
+ */
+ public void setQuery(String query)
+ {
+ _query=query;
+
+ if (_parameters!=null)
+ _parameters.clear();
+ else if (query!=null)
+ _parameters=new UrlEncoded();
+
+ if (query!=null)
+ _parameters.decode(query,__CHARSET);
+
+ cleanURI();
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Get the uri query _parameters names.
+ * @return Unmodifiable set of URI query _parameters names
+ */
+ public Set getParameterNames()
+ {
+ if (_parameters==null)
+ return Collections.EMPTY_SET;
+ return _parameters.keySet();
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Get the uri query _parameters.
+ * @return the URI query _parameters
+ */
+ public MultiMap getParameters()
+ {
+ if (_parameters==null)
+ _parameters=new UrlEncoded();
+ _dirty=true;
+ return _parameters;
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Get the uri query _parameters.
+ * @return the URI query _parameters in an unmodifiable map.
+ */
+ public Map getUnmodifiableParameters()
+ {
+ if (_parameters==null)
+ return Collections.EMPTY_MAP;
+ return Collections.unmodifiableMap(_parameters);
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Add the uri query _parameters to a MultiMap
+ */
+ public void putParametersTo(MultiMap map)
+ {
+ if (_parameters!=null && _parameters.size()>0)
+ map.putAll(_parameters);
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Clear the URI _parameters.
+ */
+ public void clearParameters()
+ {
+ if (_parameters!=null)
+ {
+ _dirty=true;
+ _parameters.clear();
+ }
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Add encoded _parameters.
+ * @param encoded A HTTP encoded string of _parameters: e.g.. "a=1&b=2"
+ */
+ public void put(String encoded)
+ {
+ UrlEncoded params = new UrlEncoded(encoded);
+ put(params);
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Add name value pair to the uri query _parameters.
+ * @param name name of value
+ * @param value The value, which may be a multi valued list or
+ * String array.
+ */
+ public Object put(Object name, Object value)
+ {
+ return getParameters().put(name,value);
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Add dictionary to the uri query _parameters.
+ */
+ public void put(Map values)
+ {
+ getParameters().putAll(values);
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Get named value
+ */
+ public String get(String name)
+ {
+ if (_parameters==null)
+ return null;
+ return (String)_parameters.get(name);
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Get named multiple values.
+ * @param name The parameter name
+ * @return Umodifiable list of values or null
+ */
+ public List getValues(String name)
+ {
+ if (_parameters==null)
+ return null;
+ return _parameters.getValues(name);
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Remove named value
+ */
+ public void remove(String name)
+ {
+ if (_parameters!=null)
+ {
+ _dirty=
+ _parameters.remove(name)!=null;
+ }
+ }
+
+ /* ------------------------------------------------------------ */
+ /** @return the URI string encoded.
+ */
+ public String toString()
+ {
+ if (_dirty)
+ {
+ getQuery();
+ cleanURI();
+ }
+ return _uri;
+ }
+
+ /* ------------------------------------------------------------ */
+ private void cleanURI()
+ {
+ StringBuffer buf = new StringBuffer(_uri.length()*2);
+ synchronized(buf)
+ {
+ if (_scheme!=null)
+ {
+ buf.append(_scheme);
+ buf.append("://");
+ buf.append(_host);
+ if (_port>0)
+ {
+ buf.append(':');
+ buf.append(_port);
+ }
+ }
+
+ buf.append(_encodedPath);
+
+ if (_query!=null && _query.length()>0)
+ {
+ buf.append('?');
+ buf.append(_query);
+ }
+ _uri=buf.toString();
+ _dirty=false;
+ }
+ }
+
+
+ /* ------------------------------------------------------------ */
+ /** Encode a URI path.
+ * This is the same encoding offered by URLEncoder, except that
+ * the '/' character is not encoded.
+ * @param path The path the encode
+ * @return The encoded path
+ */
+ public static String encodePath(String path)
+ {
+ if (path==null || path.length()==0)
+ return path;
+
+ StringBuffer buf = encodePath(null,path);
+ return buf==null?path:buf.toString();
+ }
+
+ /* ------------------------------------------------------------ */
+ /** Encode a URI path.
+ * @param path The path the encode
+ * @param buf StringBuffer to encode path into (or null)
+ * @return The StringBuffer or null if no substitutions required.
+ */
+ public static StringBuffer encodePath(StringBuffer buf, String path)
+ {
+ /* Convert path to native character set not __CHARSET.
+ * This is important to do this way because the path
+ * contains *OS specific characters* and __CHARSET could
+ * be wrong and not encode/decode the path correctly.
+ */
+ byte[] b = null;
+ /*
+ Keep commented out unless you can prove that this does the right thing.
+ try {
+ b = path.getBytes(__CHARSET);
+ } catch(UnsupportedEncodingException ex) {
+ return null; // Shouldn't be possible.
+ }
+ */
+ b = path.getBytes();
+ StringBuffer x = new StringBuffer(b.length);
+ for(int i=0; i
") - .append(_("1 sec")) // formatDuration2() would say 1000 ms + .append(DataHelper.formatDuration2(3 * 1000)) // lie and say 3 sec since 1 sec would appear as 1000 ms .append(": | ") .append(_helper.getSecondKBps()) .append("Bps | ") .append(_helper.getInboundTransferred()) - .append(" / ") + .append(SummaryHelper.THINSP) .append(_helper.getOutboundTransferred()) .append(" |
+<% /* note to translators - both parameters are URLs */ +%><%=intl._("Please report bugs on {0} or {1}.", + "trac.i2p2.i2p", + "trac.i2p2.de")%> +<%=intl._("You may use the username \"guest\" and password \"guest\" if you do not wish to register.")%> +
<%=intl._("Please include this information in bug reports")%>: +
+<%=intl._("Error {0}", ERROR_CODE)%>: <%=ERROR_URI%> <%=ERROR_MESSAGE%> +
+<%
+ if (ERROR_THROWABLE != null) {
+ java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream(2048);
+ java.io.PrintStream ps = new java.io.PrintStream(baos);
+ ERROR_THROWABLE.printStackTrace(ps);
+ ps.close();
+ String trace = baos.toString();
+ trace = trace.replace("&", "&").replace("<", "<").replace(">", ">");
+ trace = trace.replace("\n", "
\n");
+ out.print(trace);
+ }
+%>
+
+I2P version: <%=net.i2p.router.RouterVersion.FULL_VERSION%>
+Java version: <%=System.getProperty("java.vendor")%> <%=System.getProperty("java.version")%> (<%=System.getProperty("java.runtime.name")%> <%=System.getProperty("java.runtime.version")%>)
+Platform: <%=System.getProperty("os.name")%> <%=System.getProperty("os.arch")%> <%=System.getProperty("os.version")%>
+Processor: <%=net.i2p.util.NativeBigInteger.cpuModel()%> (<%=net.i2p.util.NativeBigInteger.cpuType()%>)
+Jbigi: <%=net.i2p.util.NativeBigInteger.loadStatus()%>
+Encoding: <%=System.getProperty("file.encoding")%>
<%=intl._("Note that system information, log timestamps, and log messages may provide clues to your location; please review everything you include in a bug report.")%>
+Более подробный список изменений можно найти в файле history.txt в каталоге Вашего I2P. +
Более подробный список изменений можно найти в файле history.txt, который находится в директории установки I2P.