mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
proto: Fix for rare FileIn hangs. (RHBZ#969845).
Yet another protocol bug! If the daemon cancels, then the library should send a cancellation chunk. It normally does this during the loop where it is uploading a file. However due to an oversight or possibly a regression when we modularized the socket code, the library did not send a cancellation chunk if the daemon cancelled just before the end of file was sent. This commit fixes this.
This commit is contained in:
@@ -376,7 +376,14 @@ guestfs___send_file (guestfs_h *g, const char *filename)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return send_file_complete (g);
|
||||
err = send_file_complete (g);
|
||||
if (err < 0) {
|
||||
if (err == -2) /* daemon sent cancellation */
|
||||
send_file_cancellation (g);
|
||||
return err;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Send a chunk of file data. */
|
||||
|
||||
Reference in New Issue
Block a user