Update of /cvsroot/freenet/Freenet0.7Rewrite/src/freenet/node
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16451/src/freenet/node

Modified Files:
        Version.java TextModeClientInterface.java 
Log Message:
135:
Case-insensitive commands

Index: Version.java
===================================================================
RCS file: /cvsroot/freenet/Freenet0.7Rewrite/src/freenet/node/Version.java,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -w -r1.129 -r1.130
--- Version.java        7 Sep 2005 18:28:57 -0000       1.129
+++ Version.java        7 Sep 2005 18:40:56 -0000       1.130
@@ -20,7 +20,7 @@
        public static final String protocolVersion = "1.0";

        /** The build number of the current revision */
-       public static final int buildNumber = 134;
+       public static final int buildNumber = 135;

        /** Oldest build of Fred we will talk to */
        public static final int lastGoodBuild = 131;

Index: TextModeClientInterface.java
===================================================================
RCS file: 
/cvsroot/freenet/Freenet0.7Rewrite/src/freenet/node/TextModeClientInterface.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -w -r1.21 -r1.22
--- TextModeClientInterface.java        7 Sep 2005 18:28:57 -0000       1.21
+++ TextModeClientInterface.java        7 Sep 2005 18:40:56 -0000       1.22
@@ -84,7 +84,8 @@
             return;
         }
         if(line == null) line = "QUIT";
-        if(line.startsWith("GET:")) {
+        String uline = line.toLowerCase();
+        if(uline.startsWith("GET:")) {
             // Should have a key next
             String key = line.substring("GET:".length());
             while(key.length() > 0 && key.charAt(0) == ' ')
@@ -119,7 +120,7 @@
                 System.out.println("Decoded data:\n");
                 System.out.println(new String(decoded));
             }
-        } else if(line.startsWith("GETFILE:")) {
+        } else if(uline.startsWith("GETFILE:")) {
             // Should have a key next
             String key = line.substring("GETFILE:".length());
             while(key.length() > 0 && key.charAt(0) == ' ')
@@ -178,10 +179,10 @@
                     }
                 }
             }
-        } else if(line.startsWith("QUIT")) {
+        } else if(uline.startsWith("QUIT")) {
             System.out.println("Goodbye.");
             System.exit(0);
-        } else if(line.startsWith("PUT:")) {
+        } else if(uline.startsWith("PUT:")) {
             // Just insert to local store
             line = line.substring("PUT:".length());
             while(line.length() > 0 && line.charAt(0) == ' ')
@@ -211,7 +212,7 @@
             n.putCHK(block);
             // Definitely interface
             System.out.println("URI: "+uri);
-        } else if(line.startsWith("PUTFILE:")) {
+        } else if(uline.startsWith("PUTFILE:")) {
             // Just insert to local store
             line = line.substring("PUTFILE:".length());
             while(line.length() > 0 && line.charAt(0) == ' ')
@@ -251,12 +252,12 @@
                 System.out.println("Threw: "+t);
                 t.printStackTrace();
             }
-        } else if(line.startsWith("STATUS")) {
+        } else if(uline.startsWith("STATUS")) {
             SimpleFieldSet fs = n.exportFieldSet();
             System.out.println(fs.toString());
             System.out.println();
             System.out.println(n.getStatus());
-        } else if(line.startsWith("CONNECT:")) {
+        } else if(uline.startsWith("CONNECT:")) {
             String key = line.substring("CONNECT:".length());
             while(key.length() > 0 && key.charAt(0) == ' ')
                 key = key.substring(1);
@@ -285,7 +286,7 @@
                 if(content.equals("")) return;
                 connect(content);
             }
-        } else if(line.startsWith("NAME:")) {
+        } else if(uline.startsWith("NAME:")) {
             System.out.println("Node name currently: "+n.myName);
             String key = line.substring("NAME:".length());
             while(key.length() > 0 && key.charAt(0) == ' ')


Reply via email to