Version 1.11.19.
[libguestfs.git] / daemon / base64.c
index 7e07a6a..8aca5b7 100644 (file)
@@ -77,14 +77,15 @@ do_base64_in (const char *file)
     return -1;
   }
   if (r == -2) {               /* cancellation from library */
+    /* This error is ignored by the library since it initiated the
+     * cancel.  Nevertheless we must send an error reply here.
+     */
+    reply_with_error ("file upload cancelled");
     pclose (fp);
-    /* Do NOT send any error. */
     return -1;
   }
 
   if (pclose (fp) != 0) {
-    if (r == -1)                /* if r == 0, file transfer ended already */
-      cancel_receive ();
     reply_with_error ("base64 subcommand failed on file: %s", file);
     return -1;
   }