Browse Source

fix progress for send/body reqs.

Martin Kunz 5 years ago
parent
commit
ae93c52876

+ 2 - 1
src/main/java/com/acdp/transceivr/LoadTools.java

@@ -147,7 +147,8 @@ public class LoadTools {
         };
         if(t.body!=null)
             upload(t, new ByteArrayInputStream(t.body.getBytes()));
-        else
+        else {
             download(t, progressListener);
+        }
     }
 }

+ 4 - 0
src/main/java/com/acdp/transceivr/WebServer.java

@@ -105,6 +105,10 @@ public class WebServer {
         try {
             Transfer t = new Transfer(nextID++);
             t.body=body;
+            if(t.body!=null) {
+                t.bytesRead=t.body.length();
+                t.contentLength=t.body.length();
+            }
             t.from = req.queryParams("from");
             t.to = req.queryParams("to");
             t.toMethod = req.queryParamOrDefault("toMethod", "POST");