Matt McCutchen's Web Site
/
rsync
/
rsync-patches.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
26c810d
)
Modified to work with the new FSOCKERR log code.
author
Wayne Davison
<wayned@samba.org>
Thu, 2 Feb 2006 00:34:29 +0000
(
00:34
+0000)
committer
Wayne Davison
<wayned@samba.org>
Thu, 2 Feb 2006 00:34:29 +0000
(
00:34
+0000)
threaded-receiver.diff
patch
|
blob
|
blame
|
history
diff --git
a/threaded-receiver.diff
b/threaded-receiver.diff
index
b553729
..
78d15ae
100644
(file)
--- a/
threaded-receiver.diff
+++ b/
threaded-receiver.diff
@@
-31,7
+31,7
@@
Be sure to run "make proto" before running "make".
CC=@CC@
CFLAGS=@CFLAGS@
CPPFLAGS=@CPPFLAGS@
CC=@CC@
CFLAGS=@CFLAGS@
CPPFLAGS=@CPPFLAGS@
---- orig/cleanup.c 2006-0
1-30 07:18:27
+--- orig/cleanup.c 2006-0
2-01 19:37:05
+++ cleanup.c 2005-12-08 23:17:08
@@ -94,9 +94,6 @@ void _exit_cleanup(int code, const char
}
+++ cleanup.c 2005-12-08 23:17:08
@@ -94,9 +94,6 @@ void _exit_cleanup(int code, const char
}
@@
-43,7
+43,7
@@
Be sure to run "make proto" before running "make".
if (verbose > 3) {
rprintf(FINFO,"_exit_cleanup(code=%d, file=%s, line=%d): entered\n",
code, file, line);
if (verbose > 3) {
rprintf(FINFO,"_exit_cleanup(code=%d, file=%s, line=%d): entered\n",
code, file, line);
-@@ -12
7,8 +124
,6 @@ void _exit_cleanup(int code, const char
+@@ -12
8,8 +125
,6 @@ void _exit_cleanup(int code, const char
io_flush(FULL_FLUSH);
if (cleanup_fname)
do_unlink(cleanup_fname);
io_flush(FULL_FLUSH);
if (cleanup_fname)
do_unlink(cleanup_fname);
@@
-62,9
+62,9
@@
Be sure to run "make proto" before running "make".
#define RERR_SIGNAL 20 /* status returned when sent SIGINT, SIGTERM, SIGHUP */
#define RERR_WAITCHILD 21 /* some error returned by waitpid() */
#define RERR_MALLOC 22 /* error allocating core memory buffers */
#define RERR_SIGNAL 20 /* status returned when sent SIGINT, SIGTERM, SIGHUP */
#define RERR_WAITCHILD 21 /* some error returned by waitpid() */
#define RERR_MALLOC 22 /* error allocating core memory buffers */
---- orig/generator.c 2006-01-31
02:30:18
+--- orig/generator.c 2006-01-31
18:59:39
+++ generator.c 2005-12-08 23:17:08
+++ generator.c 2005-12-08 23:17:08
-@@ -6
7,7 +67
,6 @@ extern OFF_T min_size;
+@@ -6
8,7 +68
,6 @@ extern OFF_T min_size;
extern int io_error;
extern int allowed_lull;
extern int sock_f_out;
extern int io_error;
extern int allowed_lull;
extern int sock_f_out;
@@
-72,7
+72,7
@@
Be sure to run "make proto" before running "make".
extern int protocol_version;
extern int fuzzy_basis;
extern int always_checksum;
extern int protocol_version;
extern int fuzzy_basis;
extern int always_checksum;
-@@ -9
8,6 +97
,11 @@ static int deletion_count = 0; /* used t
+@@ -9
9,6 +98
,11 @@ static int deletion_count = 0; /* used t
static int can_link_symlinks = 1; /* start out optimistic */
static int can_link_devices = 1;
static int can_link_symlinks = 1; /* start out optimistic */
static int can_link_devices = 1;
@@
-84,7
+84,7
@@
Be sure to run "make proto" before running "make".
/* For calling delete_file() */
#define DEL_FORCE_RECURSE (1<<1) /* recurse even w/o --force */
#define DEL_TERSE (1<<3)
/* For calling delete_file() */
#define DEL_FORCE_RECURSE (1<<1) /* recurse even w/o --force */
#define DEL_TERSE (1<<3)
-@@ -44
7,8 +451
,8 @@ static void sum_sizes_sqroot(struct sum_
+@@ -44
8,8 +452
,8 @@ static void sum_sizes_sqroot(struct sum_
}
if (protocol_version < 27) {
}
if (protocol_version < 27) {
@@
-95,7
+95,7
@@
Be sure to run "make proto" before running "make".
s2length = SUM_LENGTH;
} else {
int32 c;
s2length = SUM_LENGTH;
} else {
int32 c;
-@@ -45
8,7 +462
,7 @@ static void sum_sizes_sqroot(struct sum_
+@@ -45
9,7 +463
,7 @@ static void sum_sizes_sqroot(struct sum_
for (c = blength; c >>= 1 && b; b--) {}
/* add a bit, subtract rollsum, round up. */
s2length = (b + 1 - 32 + 7) / 8; /* --optimize in compiler-- */
for (c = blength; c >>= 1 && b; b--) {}
/* add a bit, subtract rollsum, round up. */
s2length = (b + 1 - 32 + 7) / 8; /* --optimize in compiler-- */
@@
-104,7
+104,7
@@
Be sure to run "make proto" before running "make".
s2length = MIN(s2length, SUM_LENGTH);
}
s2length = MIN(s2length, SUM_LENGTH);
}
-@@ -49
2,7 +496
,7 @@ static void generate_and_send_sums(int f
+@@ -49
3,7 +497
,7 @@ static void generate_and_send_sums(int f
sum_sizes_sqroot(&sum, len);
write_sum_head(f_out, &sum);
sum_sizes_sqroot(&sum, len);
write_sum_head(f_out, &sum);
@@
-113,7
+113,7
@@
Be sure to run "make proto" before running "make".
return;
if (len > 0)
return;
if (len > 0)
-@@ -51
1,7 +515
,7 @@ static void generate_and_send_sums(int f
+@@ -51
2,7 +516
,7 @@ static void generate_and_send_sums(int f
if (f_copy >= 0) {
full_write(f_copy, map, n1);
if (f_copy >= 0) {
full_write(f_copy, map, n1);
@@
-122,7
+122,7
@@
Be sure to run "make proto" before running "make".
continue;
}
continue;
}
-@@ -114
1,7 +1145
,7 @@ static void recv_generator(char *fname,
+@@ -114
2,7 +1146
,7 @@ static void recv_generator(char *fname,
return;
}
return;
}
@@
-131,7
+131,7
@@
Be sure to run "make proto" before running "make".
return;
if (fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH)
return;
if (fnamecmp_type <= FNAMECMP_BASIS_DIR_HIGH)
-@@ -119
6,7 +1200
,7 @@ static void recv_generator(char *fname,
+@@ -119
7,7 +1201
,7 @@ static void recv_generator(char *fname,
goto notify_others;
}
goto notify_others;
}
@@
-140,7
+140,7
@@
Be sure to run "make proto" before running "make".
if (!(backupptr = get_backup_name(fname))) {
close(fd);
return;
if (!(backupptr = get_backup_name(fname))) {
close(fd);
return;
-@@ -128
5,7 +1289
,10 @@ void generate_files(int f_out, struct fi
+@@ -128
6,7 +1290
,10 @@ void generate_files(int f_out, struct fi
int save_ignore_existing = ignore_existing;
int save_ignore_non_existing = ignore_non_existing;
int save_do_progress = do_progress;
int save_ignore_existing = ignore_existing;
int save_ignore_non_existing = ignore_non_existing;
int save_do_progress = do_progress;
@@
-152,7
+152,7
@@
Be sure to run "make proto" before running "make".
if (protocol_version >= 29) {
itemizing = 1;
if (protocol_version >= 29) {
itemizing = 1;
-@@ -131
4,7 +1321
,7 @@ void generate_files(int f_out, struct fi
+@@ -131
5,7 +1322
,7 @@ void generate_files(int f_out, struct fi
do_delete_pass(flist);
do_progress = 0;
do_delete_pass(flist);
do_progress = 0;
@@
-161,7
+161,7
@@
Be sure to run "make proto" before running "make".
whole_file = 0;
if (verbose >= 2) {
rprintf(FINFO, "delta-transmission %s\n",
whole_file = 0;
if (verbose >= 2) {
rprintf(FINFO, "delta-transmission %s\n",
-@@ -132
3,12 +1330
,6 @@ void generate_files(int f_out, struct fi
+@@ -132
4,12 +1331
,6 @@ void generate_files(int f_out, struct fi
: "enabled");
}
: "enabled");
}
@@
-174,7
+174,7
@@
Be sure to run "make proto" before running "make".
for (i = 0; i < flist->count; i++) {
struct file_struct *file = flist->files[i];
for (i = 0; i < flist->count; i++) {
struct file_struct *file = flist->files[i];
-@@ -137
2,23 +1373
,34 @@ void generate_files(int f_out, struct fi
+@@ -137
3,23 +1374
,34 @@ void generate_files(int f_out, struct fi
delete_in_dir(NULL, NULL, NULL, NULL);
phase++;
delete_in_dir(NULL, NULL, NULL, NULL);
phase++;
@@
-215,7
+215,7
@@
Be sure to run "make proto" before running "make".
if (local_name)
strlcpy(fbuf, local_name, sizeof fbuf);
else
if (local_name)
strlcpy(fbuf, local_name, sizeof fbuf);
else
-@@ -140
0,27 +1412
,43 @@ void generate_files(int f_out, struct fi
+@@ -140
1,27 +1413
,43 @@ void generate_files(int f_out, struct fi
phase++;
ignore_non_existing = save_ignore_non_existing;
ignore_existing = save_ignore_existing;
phase++;
ignore_non_existing = save_ignore_non_existing;
ignore_existing = save_ignore_existing;
@@
-266,8
+266,8
@@
Be sure to run "make proto" before running "make".
}
do_progress = save_do_progress;
}
do_progress = save_do_progress;
---- orig/io.c 200
5-12-08 21:19:31
-+++ io.c 200
5-12-10 19:03:08
+--- orig/io.c 200
6-02-01 19:37:05
++++ io.c 200
6-02-01 19:50:09
@@ -47,7 +47,6 @@ extern int allowed_lull;
extern int am_server;
extern int am_daemon;
@@ -47,7 +47,6 @@ extern int allowed_lull;
extern int am_server;
extern int am_daemon;
@@
-436,7
+436,7
@@
Be sure to run "make proto" before running "make".
static void read_msg_fd(void)
{
char buf[2048];
static void read_msg_fd(void)
{
char buf[2048];
-@@ -266,4
0
+267,6 @@ static void read_msg_fd(void)
+@@ -266,4
7
+267,6 @@ static void read_msg_fd(void)
tag = (tag >> 24) - MPLEX_BASE;
switch (tag) {
tag = (tag >> 24) - MPLEX_BASE;
switch (tag) {
@@
-474,10
+474,17
@@
Be sure to run "make proto" before running "make".
- if (preserve_hard_links)
- flist_ndx_push(&hlink_list, IVAL(buf,0));
- break;
- if (preserve_hard_links)
- flist_ndx_push(&hlink_list, IVAL(buf,0));
- break;
+- case MSG_SOCKERR:
+- if (!am_generator) {
+- rprintf(FERROR, "invalid message %d:%d\n", tag, len);
+- exit_cleanup(RERR_STREAMIO);
+- }
+- close_multiplexing_out();
+- /* FALL THROUGH */
case MSG_INFO:
case MSG_ERROR:
case MSG_LOG:
case MSG_INFO:
case MSG_ERROR:
case MSG_LOG:
-@@ -32
0,71 +287,72
@@ static void read_msg_fd(void)
+@@ -32
7,71 +287,75
@@ static void read_msg_fd(void)
msg_fd_in = fd;
}
msg_fd_in = fd;
}
@@
-522,6
+529,9
@@
Be sure to run "make proto" before running "make".
- written = 0;
+ struct msg_list_item *ml = (struct msg_list_item *)msg_list.head;
+ switch (ml->code) {
- written = 0;
+ struct msg_list_item *ml = (struct msg_list_item *)msg_list.head;
+ switch (ml->code) {
++ case MSG_SOCKERR:
++ close_multiplexing_out();
++ /* FALL THROUGH */
+ case MSG_INFO:
+ case MSG_ERROR:
+ case MSG_LOG:
+ case MSG_INFO:
+ case MSG_ERROR:
+ case MSG_LOG:
@@
-594,7
+604,7
@@
Be sure to run "make proto" before running "make".
return flist_ndx_pop(&hlink_list);
}
return flist_ndx_pop(&hlink_list);
}
-@@ -4
65,11 +433
,6 @@ static int read_timeout(int fd, char *bu
+@@ -4
71,11 +435
,6 @@ static int read_timeout(int fd, char *bu
FD_ZERO(&r_fds);
FD_ZERO(&w_fds);
FD_SET(fd, &r_fds);
FD_ZERO(&r_fds);
FD_ZERO(&w_fds);
FD_SET(fd, &r_fds);
@@
-606,7
+616,7
@@
Be sure to run "make proto" before running "make".
if (io_filesfrom_f_out >= 0) {
int new_fd;
if (io_filesfrom_buflen == 0) {
if (io_filesfrom_f_out >= 0) {
int new_fd;
if (io_filesfrom_buflen == 0) {
-@@ -50
2,9 +465
,6 @@ static int read_timeout(int fd, char *bu
+@@ -50
8,9 +467
,6 @@ static int read_timeout(int fd, char *bu
continue;
}
continue;
}
@@
-616,7
+626,7
@@
Be sure to run "make proto" before running "make".
if (io_filesfrom_f_out >= 0) {
if (io_filesfrom_buflen) {
if (FD_ISSET(io_filesfrom_f_out, &w_fds)) {
if (io_filesfrom_f_out >= 0) {
if (io_filesfrom_buflen) {
if (FD_ISSET(io_filesfrom_f_out, &w_fds)) {
-@@ -83
2,6 +792
,8 @@ static void readfd(int fd, char *buffer,
+@@ -83
1,6 +787
,8 @@ static void readfd(int fd, char *buffer,
}
if (fd == write_batch_monitor_in) {
}
if (fd == write_batch_monitor_in) {
@@
-625,7
+635,7
@@
Be sure to run "make proto" before running "make".
if ((size_t)write(batch_fd, buffer, total) != total)
exit_cleanup(RERR_FILEIO);
}
if ((size_t)write(batch_fd, buffer, total) != total)
exit_cleanup(RERR_FILEIO);
}
-@@ -10
91,7 +1053
,6 @@ static void writefd_unbuffered(int fd,ch
+@@ -10
86,7 +1044
,6 @@ static void writefd_unbuffered(int fd,ch
* to grab any messages they sent before they died. */
while (fd == sock_f_out && io_multiplexing_in) {
set_io_timeout(30);
* to grab any messages they sent before they died. */
while (fd == sock_f_out && io_multiplexing_in) {
set_io_timeout(30);
@@
-633,16
+643,16
@@
Be sure to run "make proto" before running "make".
readfd_unbuffered(sock_f_in, io_filesfrom_buf,
sizeof io_filesfrom_buf);
}
readfd_unbuffered(sock_f_in, io_filesfrom_buf,
sizeof io_filesfrom_buf);
}
-@@ -1
101,7 +1062
,7 @@ static void writefd_unbuffered(int fd,ch
- total +=
re
t;
+@@ -1
096,7 +1053
,7 @@ static void writefd_unbuffered(int fd,ch
+ total +=
cn
t;
if (fd == sock_f_out) {
- if (io_timeout || am_generator)
+ if (io_timeout || am_generator())
last_io_out = time(NULL);
if (fd == sock_f_out) {
- if (io_timeout || am_generator)
+ if (io_timeout || am_generator())
last_io_out = time(NULL);
- sleep_for_bwlimit(
re
t);
+ sleep_for_bwlimit(
cn
t);
}
}
-@@ -112
6,7 +108
7,7 @@ static void mplex_write(enum msgcode cod
+@@ -112
0,7 +107
7,7 @@ static void mplex_write(enum msgcode cod
* cause output to occur down the socket. Setting contiguous_write_len
* prevents the reading of msg_fd_in once we actually start to write
* this sequence of data (though we might read it before the start). */
* cause output to occur down the socket. Setting contiguous_write_len
* prevents the reading of msg_fd_in once we actually start to write
* this sequence of data (though we might read it before the start). */
@@
-651,7
+661,7
@@
Be sure to run "make proto" before running "make".
contiguous_write_len = len + 4;
if (n > sizeof buffer - 4)
contiguous_write_len = len + 4;
if (n > sizeof buffer - 4)
-@@ -11
41,33 +1102,31
@@ static void mplex_write(enum msgcode cod
+@@ -11
35,31 +1092,29
@@ static void mplex_write(enum msgcode cod
if (len)
writefd_unbuffered(sock_f_out, buf, len);
if (len)
writefd_unbuffered(sock_f_out, buf, len);
@@
-660,7
+670,6
@@
Be sure to run "make proto" before running "make".
contiguous_write_len = 0;
}
contiguous_write_len = 0;
}
-
void io_flush(int flush_it_all)
{
- msg_list_flush(flush_it_all);
void io_flush(int flush_it_all)
{
- msg_list_flush(flush_it_all);
@@
-686,7
+695,6
@@
Be sure to run "make proto" before running "make".
+ msg_list_flush(flush_it_all);
}
+ msg_list_flush(flush_it_all);
}
-
static void writefd(int fd,char *buf,size_t len)
{
- if (fd == msg_fd_out) {
static void writefd(int fd,char *buf,size_t len)
{
- if (fd == msg_fd_out) {
@@
-697,7
+705,7
@@
Be sure to run "make proto" before running "make".
if (fd == sock_f_out)
stats.total_written += len;
if (fd == sock_f_out)
stats.total_written += len;
-@@ -13
87,9 +1346
,3 @@ void start_write_batch(int fd)
+@@ -13
72,9 +1327
,3 @@ void start_write_batch(int fd)
else
write_batch_monitor_in = fd;
}
else
write_batch_monitor_in = fd;
}
@@
-707,7
+715,7
@@
Be sure to run "make proto" before running "make".
- write_batch_monitor_out = -1;
- write_batch_monitor_in = -1;
-}
- write_batch_monitor_out = -1;
- write_batch_monitor_in = -1;
-}
---- orig/log.c 2006-0
1-26 10:45:39
+--- orig/log.c 2006-0
2-01 19:37:05
+++ log.c 2005-12-16 23:49:57
@@ -35,7 +35,6 @@ extern int am_sender;
extern int local_server;
+++ log.c 2005-12-16 23:49:57
@@ -35,7 +35,6 @@ extern int am_sender;
extern int local_server;
@@
-726,8
+734,8
@@
Be sure to run "make proto" before running "make".
{ RERR_WAITCHILD , "waitpid() failed" },
{ RERR_MALLOC , "error allocating core memory buffers" },
@@ -224,8 +222,8 @@ void rwrite(enum logcode code, char *buf
{ RERR_WAITCHILD , "waitpid() failed" },
{ RERR_MALLOC , "error allocating core memory buffers" },
@@ -224,8 +222,8 @@ void rwrite(enum logcode code, char *buf
- if (
len < 0
)
-
exit_cleanup(RERR_MESSAGEIO)
;
+ if (
quiet && code == FINFO
)
+
return
;
- if (am_server && msg_fd_out >= 0) {
- /* Pass the message to our sibling. */
- if (am_server && msg_fd_out >= 0) {
- /* Pass the message to our sibling. */
@@
-1158,12
+1166,12
@@
Be sure to run "make proto" before running "make".
- return am_sender ? "sender" : am_generator ? "generator" : "receiver";
+ return am_sender ? "sender" : am_generator() ? "generator" : "receiver";
}
- return am_sender ? "sender" : am_generator ? "generator" : "receiver";
+ return am_sender ? "sender" : am_generator() ? "generator" : "receiver";
}
---- orig/rsync.h 2006-0
1-30 20:39:09
+--- orig/rsync.h 2006-0
2-01 19:37:05
+++ rsync.h 2006-01-17 02:46:03
@@ -166,10 +166,8 @@ enum msgcode {
MSG_DATA=0, /* raw data on the multiplexed stream */
MSG_ERROR=FERROR, MSG_INFO=FINFO, /* remote logging */
+++ rsync.h 2006-01-17 02:46:03
@@ -166,10 +166,8 @@ enum msgcode {
MSG_DATA=0, /* raw data on the multiplexed stream */
MSG_ERROR=FERROR, MSG_INFO=FINFO, /* remote logging */
- MSG_LOG=FLOG,
/* sibling logging */
+ MSG_LOG=FLOG,
MSG_SOCKERR=FSOCKERR,
/* sibling logging */
- MSG_REDO=9, /* reprocess indicated flist index */
MSG_SUCCESS=100,/* successfully updated indicated flist index */
MSG_DELETED=101,/* successfully deleted a file on receiving side */
- MSG_REDO=9, /* reprocess indicated flist index */
MSG_SUCCESS=100,/* successfully updated indicated flist index */
MSG_DELETED=101,/* successfully deleted a file on receiving side */