From bee04ed05c38e333e6971d552e4bf063105b01cd Mon Sep 17 00:00:00 2001
From: Christian Pointner <equinox@helsinki.at>
Date: Sat, 23 Jul 2016 22:10:02 +0200
Subject: improved logging in error case at webupload


diff --git a/src/rhimportd/uploadWeb.go b/src/rhimportd/uploadWeb.go
index d60fb22..a4f0951 100644
--- a/src/rhimportd/uploadWeb.go
+++ b/src/rhimportd/uploadWeb.go
@@ -90,7 +90,7 @@ func webUploadHandler(conf *rhimport.Config, db *rddb.DBChan, sessions *rhimport
 	}
 	defer close(attachmentChan)
 
-	rhl.Printf("WebUploadHandler: starting file upload for '%s/%s'", username, sessionid)
+	rhl.Printf("WebUploadHandler: starting file upload for '%s/%s' (ContentLength: %d)", username, sessionid, r.ContentLength)
 	sizeTotal := uint64(0)
 	hash := sha256.New()
 	body := io.TeeReader(r.Body, hash)
@@ -116,7 +116,7 @@ func webUploadHandler(conf *rhimport.Config, db *rddb.DBChan, sessions *rhimport
 
 		select {
 		case <-cancel:
-			rhl.Printf("WebUploadHandler: file upload for '%s/%s' got canceld", username, sessionid)
+			rhl.Printf("WebUploadHandler: file upload for '%s/%s' got canceld after %d bytes", username, sessionid, sizeTotal)
 			webUploadErrorResponse(w, http.StatusNoContent, "canceled")
 			return
 		case attachmentChan <- chunk:
diff --git a/web-static/upload.html b/web-static/upload.html
index 21d1c48..6b0908e 100644
--- a/web-static/upload.html
+++ b/web-static/upload.html
@@ -25,6 +25,7 @@
     <script type="text/javascript">
       function upload() {
         $('#buttonupload').attr('disabled','disabled');
+        $('#result').empty();
 
         var command = {
           type: "POST",
-- 
cgit v0.10.2