forked from I2P_Developers/i2p.i2p
* Streaming: Throw chained IOE from streams to get correct location
This commit is contained in:
@ -542,8 +542,9 @@ class Connection {
|
||||
_context.simpleScheduler().addEvent(new DisconnectEvent(), DISCONNECT_TIMEOUT);
|
||||
}
|
||||
_resetReceived = true;
|
||||
_outputStream.streamErrorOccurred(new IOException("Reset received"));
|
||||
_inputStream.streamErrorOccurred(new IOException("Reset received"));
|
||||
IOException ioe = new IOException("Reset received");
|
||||
_outputStream.streamErrorOccurred(ioe);
|
||||
_inputStream.streamErrorOccurred(ioe);
|
||||
_connectionError = "Connection reset";
|
||||
synchronized (_connectLock) { _connectLock.notifyAll(); }
|
||||
}
|
||||
@ -998,8 +999,9 @@ class Connection {
|
||||
_log.debug(buf.toString());
|
||||
}
|
||||
|
||||
_inputStream.streamErrorOccurred(new IOException("Inactivity timeout"));
|
||||
_outputStream.streamErrorOccurred(new IOException("Inactivity timeout"));
|
||||
IOException ioe = new IOException("Inactivity timeout");
|
||||
_inputStream.streamErrorOccurred(ioe);
|
||||
_outputStream.streamErrorOccurred(ioe);
|
||||
// Clean disconnect if we have already scheduled one
|
||||
// (generally because we already sent a close)
|
||||
disconnect(_disconnectScheduledOn >= 0);
|
||||
|
@ -465,10 +465,13 @@ class MessageInputStream extends InputStream {
|
||||
}
|
||||
|
||||
private void throwAnyError() throws IOException {
|
||||
if (_streamError != null) {
|
||||
IOException ioe = _streamError;
|
||||
IOException ioe = _streamError;
|
||||
if (ioe != null) {
|
||||
_streamError = null;
|
||||
throw ioe;
|
||||
// constructor with cause not until Java 6
|
||||
IOException ioe2 = new IOException("Input stream error");
|
||||
ioe2.initCause(ioe);
|
||||
throw ioe2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -446,10 +446,13 @@ class MessageOutputStream extends OutputStream {
|
||||
public boolean getClosed() { return _closed; }
|
||||
|
||||
private void throwAnyError() throws IOException {
|
||||
if (_streamError != null) {
|
||||
IOException ioe = _streamError;
|
||||
IOException ioe = _streamError;
|
||||
if (ioe != null) {
|
||||
_streamError = null;
|
||||
throw ioe;
|
||||
// constructor with cause not until Java 6
|
||||
IOException ioe2 = new IOException("Output stream error");
|
||||
ioe2.initCause(ioe);
|
||||
throw ioe2;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user