merge of 'd34b6676e413f6e88f9e145f8ddde79a66ce6bb1'

and 'da507e67b02527a43e8cca4b5b20c2de18a3142c'
This commit is contained in:
zzz
2009-12-05 17:06:34 +00:00
7 changed files with 52 additions and 77 deletions

View File

@@ -50,7 +50,7 @@ public class DoCMDS implements Runnable {
// FIX ME // FIX ME
// I need a better way to do versioning, but this will do for now. // I need a better way to do versioning, but this will do for now.
public static final String BMAJ = "00", BMIN = "00", BREV = "09", BEXT = ""; public static final String BMAJ = "00", BMIN = "00", BREV = "0A", BEXT = "";
public static final String BOBversion = BMAJ + "." + BMIN + "." + BREV + BEXT; public static final String BOBversion = BMAJ + "." + BMIN + "." + BREV + BEXT;
private Socket server; private Socket server;
private Properties props; private Properties props;

View File

@@ -60,20 +60,9 @@ public class I2Plistener implements Runnable {
this._log = _log; this._log = _log;
this.socketManager = S; this.socketManager = S;
this.serverSocket = SS; this.serverSocket = SS;
// tgwatch = 1;
this.lives = lives; this.lives = lives;
} }
private void rlock() throws Exception {
database.getReadLock();
info.getReadLock();
}
private void runlock() throws Exception {
database.releaseReadLock();
info.releaseReadLock();
}
/** /**
* Simply listen on I2P port, and thread connections * Simply listen on I2P port, and thread connections
* *
@@ -83,34 +72,31 @@ public class I2Plistener implements Runnable {
I2PSocket sessSocket = null; I2PSocket sessSocket = null;
int conn = 0; int conn = 0;
try { try {
die: try {
{ serverSocket.setSoTimeout(50);
try {
serverSocket.setSoTimeout(50);
while (lives.get()) {
try {
sessSocket = serverSocket.accept();
g = true;
} catch (ConnectException ce) {
g = false;
} catch (SocketTimeoutException ste) {
g = false;
}
if (g) {
g = false;
conn++;
// toss the connection to a new thread.
I2PtoTCP conn_c = new I2PtoTCP(sessSocket, info, database, lives);
Thread t = new Thread(conn_c, Thread.currentThread().getName() + " I2PtoTCP " + conn);
t.start();
}
while (lives.get()) {
try {
sessSocket = serverSocket.accept();
g = true;
} catch (ConnectException ce) {
g = false;
} catch (SocketTimeoutException ste) {
g = false;
} }
} catch (I2PException e) { if (g) {
// bad shit g = false;
System.out.println("Exception " + e); conn++;
// toss the connection to a new thread.
I2PtoTCP conn_c = new I2PtoTCP(sessSocket, info, database, lives);
Thread t = new Thread(conn_c, Thread.currentThread().getName() + " I2PtoTCP " + conn);
t.start();
}
} }
} catch (I2PException e) {
// bad shit
System.out.println("Exception " + e);
} }
} finally { } finally {
try { try {

View File

@@ -104,10 +104,10 @@ public class MUXlisten implements Runnable {
this.database.releaseReadLock(); this.database.releaseReadLock();
this.info.releaseReadLock(); this.info.releaseReadLock();
socketManager = I2PSocketManagerFactory.createManager(prikey, Q);
if (this.come_in) { if (this.come_in) {
this.listener = new ServerSocket(port, backlog, host); this.listener = new ServerSocket(port, backlog, host);
} }
socketManager = I2PSocketManagerFactory.createManager(prikey, Q);
// I2PException, IOException, RuntimeException // I2PException, IOException, RuntimeException
// To bad we can't just catch and enumerate.... // To bad we can't just catch and enumerate....
// } catch (I2PException e) { // } catch (I2PException e) {
@@ -141,8 +141,6 @@ public class MUXlisten implements Runnable {
this.info.add("STARTING", new Boolean(false)); this.info.add("STARTING", new Boolean(false));
this.info.releaseWriteLock(); this.info.releaseWriteLock();
this.database.releaseWriteLock(); this.database.releaseWriteLock();
// throw new Exception(e);
// Debugging, I guess.
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException(e); throw new RuntimeException(e);
} }

View File

@@ -64,16 +64,6 @@ public class TCPlistener implements Runnable {
this.lives = lives; this.lives = lives;
} }
private void rlock() throws Exception {
database.getReadLock();
info.getReadLock();
}
private void runlock() throws Exception {
database.releaseReadLock();
info.releaseReadLock();
}
/** /**
* Simply listen on TCP port, and thread connections * Simply listen on TCP port, and thread connections
* *
@@ -81,30 +71,27 @@ public class TCPlistener implements Runnable {
public void run() { public void run() {
boolean g = false; boolean g = false;
int conn = 0; int conn = 0;
Socket server = null;
try { try {
die: try {
{ listener.setSoTimeout(50); // We don't block, we cycle and check.
try { while (lives.get()) {
Socket server = new Socket(); try {
listener.setSoTimeout(50); // We don't block, we cycle and check. server = listener.accept();
while (lives.get()) { g = true;
try { } catch (SocketTimeoutException ste) {
server = listener.accept(); g = false;
g = true; }
} catch (SocketTimeoutException ste) { if (g) {
g = false; conn++;
} // toss the connection to a new thread.
if (g) { TCPtoI2P conn_c = new TCPtoI2P(socketManager, server, info, database, lives);
conn++; Thread t = new Thread(conn_c, Thread.currentThread().getName() + " TCPtoI2P " + conn);
// toss the connection to a new thread. t.start();
TCPtoI2P conn_c = new TCPtoI2P(socketManager, server, info, database, lives); g = false;
Thread t = new Thread(conn_c, Thread.currentThread().getName() + " TCPtoI2P " + conn);
t.start();
g = false;
}
} }
} catch (IOException ioe) {
} }
} catch (IOException ioe) {
} }
} finally { } finally {
try { try {

View File

@@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: I2P routerconsole\n" "Project-Id-Version: I2P routerconsole\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-11-01 02:59+0000\n" "POT-Creation-Date: 2009-11-01 02:59+0000\n"
"PO-Revision-Date: 2009-11-30 21:35+0100\n" "PO-Revision-Date: 2009-12-04 22:22+0100\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: foo <foo@bar>\n" "Language-Team: foo <foo@bar>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@@ -2319,7 +2319,7 @@ msgstr "L'identité unique de votre routeur est"
#: src/net/i2p/router/web/SummaryBarRenderer.java:143 #: src/net/i2p/router/web/SummaryBarRenderer.java:143
msgid "never reveal it to anyone" msgid "never reveal it to anyone"
msgstr "révéler jamais à personne" msgstr "ne jamais la révéler à personne"
#: src/net/i2p/router/web/SummaryBarRenderer.java:145 #: src/net/i2p/router/web/SummaryBarRenderer.java:145
msgid "Local Identity" msgid "Local Identity"
@@ -2379,15 +2379,15 @@ msgstr ""
#: src/net/i2p/router/web/SummaryBarRenderer.java:311 #: src/net/i2p/router/web/SummaryBarRenderer.java:311
msgid "Bandwidth in/out" msgid "Bandwidth in/out"
msgstr "Bande passante entrant/sortant" msgstr "Bande passante entrante/sortante"
#: src/net/i2p/router/web/SummaryBarRenderer.java:328 #: src/net/i2p/router/web/SummaryBarRenderer.java:328
msgid "Total" msgid "Total"
msgstr "" msgstr "Totale"
#: src/net/i2p/router/web/SummaryBarRenderer.java:336 #: src/net/i2p/router/web/SummaryBarRenderer.java:336
msgid "Used" msgid "Used"
msgstr "Utilisé" msgstr "Utilisée"
#: src/net/i2p/router/web/SummaryBarRenderer.java:346 #: src/net/i2p/router/web/SummaryBarRenderer.java:346
msgid "Tunnels in/out" msgid "Tunnels in/out"

View File

@@ -1,3 +1,7 @@
2009-12-05 sponge
* BOB: fix a critical bug causing ghosts on probes
and remove unused code.
2009-12-04 zzz 2009-12-04 zzz
* Console: Close up some possible XSS (thanks Pragmatk) * Console: Close up some possible XSS (thanks Pragmatk)
* i2psnark: Config cleanup, more HTML transitional fixes * i2psnark: Config cleanup, more HTML transitional fixes

View File

@@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 25; public final static long BUILD = 26;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA; public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;