- priority: 5 --> 9
This patch fixes a race condition that can potentially
cause problems reading data from a peer. Without this
patch, it is possible for InputDataStreamAdapter.read()
to return -1 prematurely, or
InputDataStreamAdapter.read(byte,int,int) to go into an
endless loop.
RCS file:
/cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/core/InputDataStream.java,v
retrieving revision 1.6
diff -u -r1.6 InputDataStream.java
--- InputDataStream.java 23 Apr 2003 15:23:04 -0000 1.6
+++ InputDataStream.java 20 Jan 2005 23:33:24 -0000
@@ -90,9 +90,9 @@
synchronized (this.buffers) {
this.buffers.addLast(segment);
+ this.availableBytes += segment.getLength();
this.buffers.notify();
}
- this.availableBytes += segment.getLength();
}
public int available()