[Webfunds-commits] java/webfunds/sox Request.java Reply.java

Ian Grigg iang@cypherpunks.ai
Fri, 6 Apr 2001 20:00:42 -0400 (AST)


iang        01/04/06 20:00:42

  Modified:    webfunds/sox Request.java Reply.java
  Log:
  Reply had wrong request version being grabbed, needs Request Version,
  not extending sub_version;

Revision  Changes    Path
1.22      +3 -1      java/webfunds/sox/Request.java

Index: Request.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/Request.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- Request.java	2000/11/15 05:51:42	1.21
+++ Request.java	2001/04/07 00:00:41	1.22
@@ -1,5 +1,5 @@
 /*
- * $Id: Request.java,v 1.21 2000/11/15 05:51:42 iang Exp $
+ * $Id: Request.java,v 1.22 2001/04/07 00:00:41 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -48,6 +48,8 @@
     protected int req_version = REQ_SUBS_ADD_V; // for new versions, change this
 
     public int getRequestVersion()         { return req_version; }
+    public int getVersion()                { return -1; }
+
     /**
      *  Set the version number of this request.
      *  Not currently used, but something is needed.



1.18      +13 -3     java/webfunds/sox/Reply.java

Index: Reply.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/sox/Reply.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- Reply.java	2000/09/24 23:32:04	1.17
+++ Reply.java	2001/04/07 00:00:41	1.18
@@ -1,5 +1,5 @@
 /*
- * $Id: Reply.java,v 1.17 2000/09/24 23:32:04 iang Exp $
+ * $Id: Reply.java,v 1.18 2001/04/07 00:00:41 iang Exp $
  *
  * Copyright (c) Systemics Ltd 1995-1999 on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -21,6 +21,10 @@
      *  Initialised to the Request version number.
      */
     protected int req_version = 0;
+    /**
+     *  Initialised to the extending request version number.
+     */
+    protected int sub_version = 0;
 
     /**
      * An identifier for the request, used to pair up
@@ -92,6 +96,7 @@
     {
         this.requestId = request.getRequestId();
         this.req_version = request.getRequestVersion();
+        this.sub_version = request.getVersion();
         this.errorNumber = errNum;
     }
   
@@ -104,6 +109,7 @@
     {
         this.requestId = request.getRequestId();
         this.req_version = request.getRequestVersion();
+        this.sub_version = request.getVersion();
     }
   
     /**
@@ -124,7 +130,9 @@
     protected Reply(Request request, byte[] replyData)
         throws SOXPacketException
     {
-        req_version = request.getRequestVersion();
+        this.req_version = request.getRequestVersion();
+        this.sub_version = request.getVersion();
+
         // now, we can test version to see what format data follows
         decode(replyData);
     }
@@ -141,7 +149,9 @@
     protected Reply(Request request, InputStream is)
         throws SOXPacketException
     {
-        req_version = request.getRequestVersion();
+        this.req_version = request.getRequestVersion();
+        this.sub_version = request.getVersion();
+
         decode(is);
     }