I/O error for the incremental directory that generated the error. The
PROTOCOL_VERSION was bumped to 31 to implement this.
NEWS for rsync 3.1.0 (UNRELEASED)
NEWS for rsync 3.1.0 (UNRELEASED)
-Protocol: 30 (unchanged)
Changes since 3.0.4:
BUG FIXES:
Changes since 3.0.4:
BUG FIXES:
\f
Partial Protocol History
RELEASE DATE VER. DATE OF COMMIT* PROTOCOL
\f
Partial Protocol History
RELEASE DATE VER. DATE OF COMMIT* PROTOCOL
+ ?? ??? 2008 3.1.0 31 Aug 2008 31
29 Jun 2008 3.0.3 30
08 Apr 2008 3.0.2 30
03 Apr 2008 3.0.1 30
29 Jun 2008 3.0.3 30
08 Apr 2008 3.0.2 30
03 Apr 2008 3.0.1 30
dp = F_DIR_NODE_P(file);
}
dp = F_DIR_NODE_P(file);
}
+ if (protocol_version < 31 || io_error == save_io_error || ignore_errors)
+ write_byte(f, 0);
+ else {
+ write_shortint(f, XMIT_EXTENDED_FLAGS|XMIT_IO_ERROR_ENDLIST);
+ write_int(f, io_error);
+ }
if (need_unsorted_flist) {
if (!(flist->sorted = new_array(struct file_struct *, flist->used)))
if (need_unsorted_flist) {
if (!(flist->sorted = new_array(struct file_struct *, flist->used)))
- if (io_error != save_io_error && !ignore_errors)
+ if (io_error != save_io_error && protocol_version == 30 && !ignore_errors)
send_msg_int(MSG_IO_ERROR, io_error);
}
send_msg_int(MSG_IO_ERROR, io_error);
}
stats.flist_buildtime = 1;
start_tv = end_tv;
stats.flist_buildtime = 1;
start_tv = end_tv;
- write_byte(f, 0); /* Indicate end of file list */
+ /* Indicate end of file list */
+ if (protocol_version < 31 || io_error == 0 || ignore_errors)
+ write_byte(f, 0);
+ else {
+ write_shortint(f, XMIT_EXTENDED_FLAGS|XMIT_IO_ERROR_ENDLIST);
+ write_int(f, io_error);
+ }
#ifdef SUPPORT_HARD_LINKS
if (preserve_hard_links && protocol_version >= 30 && !inc_recurse)
#ifdef SUPPORT_HARD_LINKS
if (preserve_hard_links && protocol_version >= 30 && !inc_recurse)
/* send the io_error flag */
if (protocol_version < 30)
write_int(f, ignore_errors ? 0 : io_error);
/* send the io_error flag */
if (protocol_version < 30)
write_int(f, ignore_errors ? 0 : io_error);
- else if (io_error && !ignore_errors)
+ else if (io_error && protocol_version == 30 && !ignore_errors)
send_msg_int(MSG_IO_ERROR, io_error);
if (disable_buffering)
send_msg_int(MSG_IO_ERROR, io_error);
if (disable_buffering)
while ((flags = read_byte(f)) != 0) {
struct file_struct *file;
while ((flags = read_byte(f)) != 0) {
struct file_struct *file;
- flist_expand(flist, 1);
-
if (protocol_version >= 28 && (flags & XMIT_EXTENDED_FLAGS))
flags |= read_byte(f) << 8;
if (protocol_version >= 28 && (flags & XMIT_EXTENDED_FLAGS))
flags |= read_byte(f) << 8;
+
+ if (flags == (XMIT_EXTENDED_FLAGS|XMIT_IO_ERROR_ENDLIST)) {
+ int err;
+ if (protocol_version < 31) {
+ rprintf(FERROR, "Invalid flist flag: %x\n", flags);
+ exit_cleanup(RERR_PROTOCOL);
+ }
+ err = read_int(f);
+ if (!ignore_errors)
+ io_error |= err;
+ break;
+ }
+
+ flist_expand(flist, 1);
file = recv_file_entry(flist, flags, f);
if (inc_recurse && S_ISDIR(file->mode)) {
file = recv_file_entry(flist, flags, f);
if (inc_recurse && S_ISDIR(file->mode)) {
if (protocol_version < 30) {
/* Recv the io_error flag */
if (protocol_version < 30) {
/* Recv the io_error flag */
- if (ignore_errors)
- read_int(f);
- else
- io_error |= read_int(f);
+ int err = read_int(f);
+ if (!ignore_errors)
+ io_error |= err;
} else if (inc_recurse && flist->ndx_start == 1) {
if (!file_total || strcmp(flist->sorted[flist->low]->basename, ".") != 0)
flist->parent_ndx = -1;
} else if (inc_recurse && flist->ndx_start == 1) {
if (!file_total || strcmp(flist->sorted[flist->low]->basename, ".") != 0)
flist->parent_ndx = -1;
extern int max_delete;
extern int force_delete;
extern int one_file_system;
extern int max_delete;
extern int force_delete;
extern int one_file_system;
-extern int check_for_io_err;
extern struct stats stats;
extern dev_t filesystem_dev;
extern mode_t orig_umask;
extern struct stats stats;
extern dev_t filesystem_dev;
extern mode_t orig_umask;
dirdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
} else
dirdev = MAKEDEV(0, 0);
dirdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp));
} else
dirdev = MAKEDEV(0, 0);
- /* We must be sure we've had a chance to receive an I/O
- * error for this directory before we delete in it. */
- while (check_for_io_err && !cur_flist->next && !flist_eof)
- wait_for_receiver();
delete_in_dir(fbuf, fp, &dirdev);
} else
change_local_filter_dir(fbuf, strlen(fbuf), F_DEPTH(fp));
delete_in_dir(fbuf, fp, &dirdev);
} else
change_local_filter_dir(fbuf, strlen(fbuf), F_DEPTH(fp));
int ignore_timeout = 0;
int batch_fd = -1;
int msgdone_cnt = 0;
int ignore_timeout = 0;
int batch_fd = -1;
int msgdone_cnt = 0;
-int check_for_io_err = 0;
/* Ignore an EOF error if non-zero. See whine_about_eof(). */
int kluge_around_eof = 0;
/* Ignore an EOF error if non-zero. See whine_about_eof(). */
int kluge_around_eof = 0;
len = tag & 0xFFFFFF;
tag = (tag >> 24) - MPLEX_BASE;
len = tag & 0xFFFFFF;
tag = (tag >> 24) - MPLEX_BASE;
- check_for_io_err = 0;
-
switch (tag) {
case MSG_DONE:
if (len < 0 || len > 1 || !am_generator) {
switch (tag) {
case MSG_DONE:
if (len < 0 || len > 1 || !am_generator) {
}
flist = recv_file_list(fd);
flist->parent_ndx = IVAL(buf,0);
}
flist = recv_file_list(fd);
flist->parent_ndx = IVAL(buf,0);
- /* If the sender is going to send us an MSG_IO_ERROR value, it
- * will always be the very next message following MSG_FLIST. */
- check_for_io_err = 1;
#ifdef SUPPORT_HARD_LINKS
if (preserve_hard_links)
match_hard_links(flist);
#ifdef SUPPORT_HARD_LINKS
if (preserve_hard_links)
match_hard_links(flist);
msg_bytes = tag & 0xFFFFFF;
tag = (tag >> 24) - MPLEX_BASE;
msg_bytes = tag & 0xFFFFFF;
tag = (tag >> 24) - MPLEX_BASE;
- check_for_io_err = 0;
-
switch (tag) {
case MSG_DATA:
if (msg_bytes > iobuf_in_siz) {
switch (tag) {
case MSG_DATA:
if (msg_bytes > iobuf_in_siz) {
extern int read_batch;
extern int write_batch;
extern int batch_fd;
extern int read_batch;
extern int write_batch;
extern int batch_fd;
-extern int delete_during;
extern int connect_timeout;
extern int connect_timeout;
-extern int check_for_io_err;
extern pid_t cleanup_child_pid;
extern unsigned int module_dirlen;
extern struct stats stats;
extern pid_t cleanup_child_pid;
extern unsigned int module_dirlen;
extern struct stats stats;
exit_cleanup(RERR_IPC);
}
exit_cleanup(RERR_IPC);
}
- check_for_io_err = inc_recurse && delete_during && !flist_eof;
-
if (pid == 0) {
close(error_pipe[0]);
if (f_in != f_out)
if (pid == 0) {
close(error_pipe[0]);
if (f_in != f_out)
extern int msgs2stderr;
extern int keep_dirlinks;
extern int make_backups;
extern int msgs2stderr;
extern int keep_dirlinks;
extern int make_backups;
-extern int delete_during;
-extern int check_for_io_err;
extern struct file_list *cur_flist, *first_flist, *dir_flist;
extern struct chmod_mode_struct *daemon_chmod_modes;
#ifdef ICONV_OPTION
extern struct file_list *cur_flist, *first_flist, *dir_flist;
extern struct chmod_mode_struct *daemon_chmod_modes;
#ifdef ICONV_OPTION
while (1) {
ndx = read_ndx(f_in);
while (1) {
ndx = read_ndx(f_in);
- if (ndx >= 0) {
- if (check_for_io_err) {
- /* Let generator know there was no I/O error. */
- send_msg_int(MSG_IO_ERROR, 0);
- check_for_io_err = 0;
- }
- }
- check_for_io_err = 0;
if (ndx == NDX_DONE)
return ndx;
if (!inc_recurse || am_sender) {
if (ndx == NDX_DONE)
return ndx;
if (!inc_recurse || am_sender) {
stop_flist_forward();
if (!msgs2stderr)
negate_output_levels(); /* restore info/debug output */
stop_flist_forward();
if (!msgs2stderr)
negate_output_levels(); /* restore info/debug output */
- /* If the sender is going to send us an MSG_IO_ERROR value, it
- * will always be the very next message following a file list. */
- if (delete_during)
- check_for_io_err = 1;
}
iflags = protocol_version >= 29 ? read_shortint(f_in)
}
iflags = protocol_version >= 29 ? read_shortint(f_in)
#define XMIT_RDEV_MINOR_8_pre30 (1<<11) /* protocols 28 - 29 */
#define XMIT_GROUP_NAME_FOLLOWS (1<<11) /* protocols 30 - now */
#define XMIT_HLINK_FIRST (1<<12) /* protocols 30 - now (HLINKED files only) */
#define XMIT_RDEV_MINOR_8_pre30 (1<<11) /* protocols 28 - 29 */
#define XMIT_GROUP_NAME_FOLLOWS (1<<11) /* protocols 30 - now */
#define XMIT_HLINK_FIRST (1<<12) /* protocols 30 - now (HLINKED files only) */
+#define XMIT_IO_ERROR_ENDLIST (1<<12) /* protocols 31 - now (w/XMIT_EXTENDED_FLAGS) */
/* These flags are used in the live flist data. */
/* These flags are used in the live flist data. */
== ((unsigned)(b2) & (unsigned)(mask)))
/* update this if you make incompatible changes */
== ((unsigned)(b2) & (unsigned)(mask)))
/* update this if you make incompatible changes */
-#define PROTOCOL_VERSION 30
+#define PROTOCOL_VERSION 31
/* This is used when working on a new protocol version in CVS, and should
* be a new non-zero value for each CVS change that affects the protocol.
/* This is used when working on a new protocol version in CVS, and should
* be a new non-zero value for each CVS change that affects the protocol.
- * It must ALWAYS be 0 when the protocol goes final! */
-#define SUBPROTOCOL_VERSION 0
+ * It must ALWAYS be 0 when the protocol goes final (and NEVER before)! */
+#define SUBPROTOCOL_VERSION 1
/* We refuse to interoperate with versions that are not in this range.
* Note that we assume we'll work with later versions: the onus is on
/* We refuse to interoperate with versions that are not in this range.
* Note that we assume we'll work with later versions: the onus is on