소스 검색

fix progress for send/body reqs.

Martin Kunz 5 년 전
부모
커밋
ae93c52876
2개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      src/main/java/com/acdp/transceivr/LoadTools.java
  2. 4 0
      src/main/java/com/acdp/transceivr/WebServer.java

+ 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");