diff options
author | Benoit Foucher <benoit@zeroc.com> | 2013-02-28 11:59:03 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2013-02-28 11:59:03 +0100 |
commit | 48c39401d643c85e0297cd87c6d3d87763063794 (patch) | |
tree | 50a8456ede6176f0f00dcf53501cdbf55252de33 /java/src | |
parent | minor tweaks to CHANGES (diff) | |
download | ice-48c39401d643c85e0297cd87c6d3d87763063794.tar.bz2 ice-48c39401d643c85e0297cd87c6d3d87763063794.tar.xz ice-48c39401d643c85e0297cd87c6d3d87763063794.zip |
Fixed ICE-5287 - assert in connection metrics code
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/Ice/ConnectionI.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/java/src/Ice/ConnectionI.java b/java/src/Ice/ConnectionI.java index fdfbc696be5..f597ee65ec9 100644 --- a/java/src/Ice/ConnectionI.java +++ b/java/src/Ice/ConnectionI.java @@ -266,6 +266,11 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne { _observer.attach(); } + else + { + _writeStreamPos = -1; + _readStreamPos = -1; + } } synchronized public void @@ -1840,6 +1845,11 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne { _observer.attach(); } + else + { + _writeStreamPos = -1; + _readStreamPos = -1; + } } if(_observer != null && state == StateClosed && _exception != null) { @@ -2623,6 +2633,10 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne private void observerFinishRead(int pos) { + if(_readStreamPos == -1) + { + return; + } assert(pos >= _readStreamPos); _observer.receivedBytes(pos - _readStreamPos); _readStreamPos = -1; @@ -2641,6 +2655,10 @@ public final class ConnectionI extends IceInternal.EventHandler implements Conne private void observerFinishWrite(int pos) { + if(_writeStreamPos == -1) + { + return; + } assert(pos >= _writeStreamPos); _observer.sentBytes(pos - _writeStreamPos); _writeStreamPos = -1; |