forked from I2P_Developers/i2p.i2p
Streaming: Fix race NPE (thx echelon)
This commit is contained in:
@ -548,9 +548,11 @@ class Connection {
|
|||||||
|
|
||||||
void disconnectComplete() {
|
void disconnectComplete() {
|
||||||
_connected = false;
|
_connected = false;
|
||||||
if (_socket != null)
|
I2PSocketFull s = _socket;
|
||||||
_socket.destroy();
|
if (s != null) {
|
||||||
_socket = null;
|
s.destroy2();
|
||||||
|
_socket = null;
|
||||||
|
}
|
||||||
if (_outputStream != null)
|
if (_outputStream != null)
|
||||||
_outputStream.destroy();
|
_outputStream.destroy();
|
||||||
if (_receiver != null)
|
if (_receiver != null)
|
||||||
|
@ -131,12 +131,21 @@ class I2PSocketFull implements I2PSocket {
|
|||||||
|
|
||||||
void destroy() {
|
void destroy() {
|
||||||
Connection c = _connection;
|
Connection c = _connection;
|
||||||
_connection = null;
|
destroy2();
|
||||||
_listener = null;
|
|
||||||
if (c != null)
|
if (c != null)
|
||||||
c.disconnectComplete();
|
c.disconnectComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call from Connection.disconnectComplete()
|
||||||
|
* instead of destroy() so we don't loop
|
||||||
|
* @since 0.8.13
|
||||||
|
*/
|
||||||
|
void destroy2() {
|
||||||
|
_connection = null;
|
||||||
|
_listener = null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The remote port.
|
* The remote port.
|
||||||
* @return the port or 0 if unknown
|
* @return the port or 0 if unknown
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
2012-02-20 zzz
|
||||||
|
* Streaming: Fix race NPE (thx echelon)
|
||||||
|
|
||||||
2012-02-17 zzz
|
2012-02-17 zzz
|
||||||
* i2psnark: Escape fixes
|
* i2psnark: Escape fixes
|
||||||
* netdb.jsp: Fix debug median calculation
|
* netdb.jsp: Fix debug median calculation
|
||||||
|
@ -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 = 14;
|
public final static long BUILD = 15;
|
||||||
|
|
||||||
/** for example "-test" */
|
/** for example "-test" */
|
||||||
public final static String EXTRA = "-rc";
|
public final static String EXTRA = "-rc";
|
||||||
|
Reference in New Issue
Block a user