From a430691df19501367a7432a66402b4f6f603c700 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 26 Apr 2007 23:06:38 +0000 Subject: [PATCH] Prevent a hang in incremental-recursion mode when the receiver encounters an error updating the file: the receiver now sends MSG_NO_SEND to the generator so that it knows when all outstanding work is completed. --- receiver.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/receiver.c b/receiver.c index 3fdd895c..94421c09 100644 --- a/receiver.c +++ b/receiver.c @@ -470,6 +470,8 @@ int recv_files(int f_in, char *local_name) "(Skipping batched update for \"%s\")\n", fname); discard_receive_data(f_in, F_LENGTH(file)); + if (inc_recurse) + send_msg_int(MSG_NO_SEND, ndx); continue; } next_gen_ndx = -1; @@ -553,6 +555,8 @@ int recv_files(int f_in, char *local_name) full_fname(fnamecmp)); discard_receive_data(f_in, F_LENGTH(file)); close(fd1); + if (inc_recurse) + send_msg_int(MSG_NO_SEND, ndx); continue; } @@ -566,6 +570,8 @@ int recv_files(int f_in, char *local_name) full_fname(fnamecmp)); discard_receive_data(f_in, F_LENGTH(file)); close(fd1); + if (inc_recurse) + send_msg_int(MSG_NO_SEND, ndx); continue; } @@ -599,6 +605,8 @@ int recv_files(int f_in, char *local_name) discard_receive_data(f_in, F_LENGTH(file)); if (fd1 != -1) close(fd1); + if (inc_recurse) + send_msg_int(MSG_NO_SEND, ndx); continue; } } else { @@ -606,6 +614,8 @@ int recv_files(int f_in, char *local_name) discard_receive_data(f_in, F_LENGTH(file)); if (fd1 != -1) close(fd1); + if (inc_recurse) + send_msg_int(MSG_NO_SEND, ndx); continue; } @@ -632,6 +642,8 @@ int recv_files(int f_in, char *local_name) discard_receive_data(f_in, F_LENGTH(file)); if (fd1 != -1) close(fd1); + if (inc_recurse) + send_msg_int(MSG_NO_SEND, ndx); continue; } -- 2.34.1