[Webfunds-commits] java/webfunds/utils RawHttp.java

Ian Grigg iang@cypherpunks.ai
Wed, 30 Aug 2000 18:34:27 -0400 (AST)


iang        00/08/30 18:34:26

  Modified:    webfunds/utils RawHttp.java
  Log:
  Oops, returned huge buf each socket read, instead of the actual
  data that was read.  Now copied into buf of right size.  There
  might be a better way to do this, but I haven't found it yet...

Revision  Changes    Path
1.5       +7 -3      java/webfunds/utils/RawHttp.java

Index: RawHttp.java
===================================================================
RCS file: /home/webfunds/cvsroot/java/webfunds/utils/RawHttp.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- RawHttp.java	2000/07/10 17:37:54	1.4
+++ RawHttp.java	2000/08/30 22:34:26	1.5
@@ -1,5 +1,5 @@
 /*
- * $Id: RawHttp.java,v 1.4 2000/07/10 17:37:54 iang Exp $
+ * $Id: RawHttp.java,v 1.5 2000/08/30 22:34:26 iang Exp $
  *
  * Copyright (c) 2000 Systemics Inc on behalf of
  * the WebFunds Development Team.  All Rights Reserved.
@@ -127,7 +127,7 @@
             try {
                 i = is.read(buf, offset, size - offset);
             } catch (IOException ex) {
-                ex.printStackTrace();
+                // ex.printStackTrace();
                 throw new RawConnectException("sock bad (read IOEx): "+ex);
             }
         }
@@ -143,7 +143,11 @@
             throw new RawConnectException("close (IOEx): "+ex);
         }
 
-        return buf;
+        byte[] b2 = new byte[offset];
+        for (i = 0; i < offset; i++)
+            b2[i] = buf[i];
+
+        return b2;
     }