X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=daemon%2Fproto.c;fp=daemon%2Fproto.c;h=cef11463468f7431e5dd92b924cd52e51cc22897;hp=90a838861225b350d941ee02b20498a84f59e216;hb=1e68f84c5a46f3ff650368a897bd4113bd3f4aea;hpb=65852011d8f5150c5c0bcbfeac90e2fd784905c5 diff --git a/daemon/proto.c b/daemon/proto.c index 90a8388..cef1146 100644 --- a/daemon/proto.c +++ b/daemon/proto.c @@ -405,6 +405,13 @@ receive_file (receive_cb cb, void *opaque) "receive_file: got chunk: cancel = 0x%x, len = %d, buf = %p\n", chunk.cancel, chunk.data.data_len, chunk.data.data_val); + if (chunk.cancel != 0 && chunk.cancel != 1) { + fprintf (stderr, + "receive_file: chunk.cancel != [0|1] ... " + "continuing even though we have probably lost synchronization with the library\n"); + return -1; + } + if (chunk.cancel) { if (verbose) fprintf (stderr, "receive_file: received cancellation from library\n");