Revision: 3099
          http://vexi.svn.sourceforge.net/vexi/?rev=3099&view=rev
Author:   mkpg2
Date:     2008-08-28 02:44:12 +0000 (Thu, 28 Aug 2008)

Log Message:
-----------
Fix. Modified http implementation so to handle binary content.

Modified Paths:
--------------
    trunk/core/org.ibex.js/src/org/ibex/js/Fountain.java
    trunk/core/org.ibex.js/src/org/ibex/js/XMLRPC.jpp

Modified: trunk/core/org.ibex.js/src/org/ibex/js/Fountain.java
===================================================================
--- trunk/core/org.ibex.js/src/org/ibex/js/Fountain.java        2008-08-28 
02:44:01 UTC (rev 3098)
+++ trunk/core/org.ibex.js/src/org/ibex/js/Fountain.java        2008-08-28 
02:44:12 UTC (rev 3099)
@@ -221,13 +221,10 @@
                // from the http post
                ByteArrayOutputStream r = new ByteArrayOutputStream(){
                        public void close() throws IOException {
-                               String s = new String(toByteArray());
                                // HACK - hardcode mime type
-                               lastResponse= (HTTPInputStream) 
http().POST("test/xml", s, null, null);
+                               lastResponse= (HTTPInputStream) 
http().POST("test/xml", toByteArray(), null, null);
                        }
                };
-               // we write \r \n which ends the header
-               r.write(new byte[]{13,10});
                return r;
         }
     }

Modified: trunk/core/org.ibex.js/src/org/ibex/js/XMLRPC.jpp
===================================================================
--- trunk/core/org.ibex.js/src/org/ibex/js/XMLRPC.jpp   2008-08-28 02:44:01 UTC 
(rev 3098)
+++ trunk/core/org.ibex.js/src/org/ibex/js/XMLRPC.jpp   2008-08-28 02:44:12 UTC 
(rev 3099)
@@ -187,7 +187,6 @@
 
     protected String buildRequest(JSArray args) throws JSExn, IOException {
         StringBuffer content = new StringBuffer();
-        content.append("\r\n");
         content.append("<?xml version=\"1.0\"?>\n");
         content.append("    <methodCall>\n");
         content.append("        <methodName>");
@@ -343,9 +342,8 @@
             if (tracker == null) tracker = new Basket.Hash();
             if (objects == null) objects = new Basket.Array();
             String request = buildRequest(args);
-               //System.out.println(request);
-            if (Log.rpc) Log.uInfo(LOG_TYPE, "send:\n" + request);
-            InputStream is = http.POST("text/xml", request, null, null);
+               if (Log.rpc) Log.uInfo(LOG_TYPE, "send:\n" + request);
+            InputStream is = http.POST("text/xml", request.getBytes("UTF-8"), 
null, null);
             InputStreamReader ir = new InputStreamReader(is);
             BufferedReader br = Log.rpc?new LoggingReader(ir):
                                                        new BufferedReader(ir);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Vexi-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to