You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Tom Palkot <tp...@gmail.com> on 2004/12/08 03:49:20 UTC
[PATCH][COMMONS NET] TelnetInputStream Buffer Stops at 2K
Small fix. Patch file attached and below.
Bug:
Building a silent telnet client, the available() method is being used
to know how much data to read. Commands with large amounts of text,
like a "cat" return an
initial available() value of 2048, but further calls to available()
return 0, even though there is more to read.
Index: TelnetInputStream.java
===================================================================
RCS file: /home/cvspublic/jakarta-commons/net/src/java/org/apache/commons/net/telnet/TelnetInputStream.java,v
retrieving revision 1.13
diff -u -r1.13 TelnetInputStream.java
--- TelnetInputStream.java 24 Sep 2004 14:56:30 -0000 1.13
+++ TelnetInputStream.java 7 Dec 2004 00:42:07 -0000
@@ -406,6 +406,7 @@
__queueHead = 0;
--__bytesAvailable;
+ __queue.notify();
return ch;
}