aboutsummaryrefslogtreecommitdiff
path: root/src/IvyClient.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/IvyClient.java')
-rwxr-xr-xsrc/IvyClient.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/IvyClient.java b/src/IvyClient.java
index e99574c..069a45b 100755
--- a/src/IvyClient.java
+++ b/src/IvyClient.java
@@ -31,8 +31,9 @@ public class IvyClient extends Thread {
final static int SchizoToken = 6; /* avoid race condition in concurrent connexions */
final static int DirectMsg = 7;/* the peer sends a direct message */
final static int Die = 8; /* the peer wants us to quit */
- final static String StartArg = "\002";/* begin of arguments */
- final static String EndArg = "\003"; /* end of arguments */
+ /* test pour jdk1.3 */
+ final static String StartArg = "\u0002";/* begin of arguments */
+ final static String EndArg = "\u0003"; /* end of arguments */
private static boolean debug = (System.getProperty("IVY_DEBUG")!=null) ;
private Ivy bus;
@@ -150,7 +151,7 @@ public class IvyClient extends Thread {
*/
StringTokenizer st = new StringTokenizer(msg);
if(!st.hasMoreTokens()){close("Bad format no type '"+msg+"'");break;}
- token=st.nextToken();
+ token=st.nextToken().trim();
if (token.length()==0){close("Bad format no type '"+msg+"'");break;}
try {
msgtype = Integer.parseInt(token);
@@ -159,7 +160,9 @@ public class IvyClient extends Thread {
break;
}
if(!st.hasMoreTokens()){close("Bad format no id '"+msg+"'");break;}
- token=st.nextToken(StartArg);
+ /* IST */
+
+ token=st.nextToken(StartArg).trim();
/*
* TODO
* this doesn't work on jdk1.3 !!!
@@ -172,7 +175,7 @@ public class IvyClient extends Thread {
break;
}
String msgarg="";
- if (st.hasMoreTokens()) msgarg=st.nextToken("\n");
+ if (st.hasMoreTokens()) msgarg=st.nextToken("\n").trim();
/*
* second stage: process the message
*/
@@ -266,7 +269,7 @@ public class IvyClient extends Thread {
String buffer = type+" "+id+StartArg;
// Start at 1 because group 0 represent entire matching
for(int sub = 1; sub <= nbsub; sub++) {
- if (result.getSubStartIndex(sub) > -1) {
+ if (result.getStartIndex(sub) > -1) {
buffer += result.toString(sub)+EndArg;
}
}