proto: Fix both-ends-cancel case.
[libguestfs.git] / daemon / debug.c
index 091e741..cd3e8a5 100644 (file)
@@ -540,8 +540,11 @@ do_debug_upload (const char *filename, int mode)
     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");
     close (fd);
-    /* Do NOT send any error. */
     return -1;
   }