Author: toad
Date: 2006-07-28 19:32:30 +0000 (Fri, 28 Jul 2006)
New Revision: 9800
Modified:
trunk/freenet/src/freenet/node/Version.java
trunk/freenet/src/freenet/node/fcp/FCPConnectionInputHandler.java
trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
Log:
914: Fix a bug relating to malformed FCP messages.
Modified: trunk/freenet/src/freenet/node/Version.java
===================================================================
--- trunk/freenet/src/freenet/node/Version.java 2006-07-28 17:37:32 UTC (rev
9799)
+++ trunk/freenet/src/freenet/node/Version.java 2006-07-28 19:32:30 UTC (rev
9800)
@@ -18,7 +18,7 @@
public static final String protocolVersion = "1.0";
/** The build number of the current revision */
- private static final int buildNumber = 913;
+ private static final int buildNumber = 914;
/** Oldest build of Fred we will talk to */
private static final int oldLastGoodBuild = 870;
Modified: trunk/freenet/src/freenet/node/fcp/FCPConnectionInputHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPConnectionInputHandler.java
2006-07-28 17:37:32 UTC (rev 9799)
+++ trunk/freenet/src/freenet/node/fcp/FCPConnectionInputHandler.java
2006-07-28 19:32:30 UTC (rev 9800)
@@ -43,7 +43,7 @@
while(true) {
SimpleFieldSet fs;
// Read a message
- String messageType = lis.readLine(64, 64, true);
+ String messageType = lis.readLine(128, 128, true);
if(messageType == null) {
is.close();
return;
Modified: trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
===================================================================
--- trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
2006-07-28 17:37:32 UTC (rev 9799)
+++ trunk/freenet/src/freenet/support/io/LineReadingInputStream.java
2006-07-28 19:32:30 UTC (rev 9800)
@@ -19,6 +19,8 @@
* Read a \n or \r\n terminated line of UTF-8 or ISO-8859-1.
*/
public String readLine(int maxLength, int bufferSize, boolean utf)
throws IOException {
+ if(maxLength < bufferSize)
+ bufferSize = maxLength;
if(buf == null)
buf = new byte[Math.max(Math.min(128,maxLength),
Math.min(1024, bufferSize))];
int ctr = 0;