aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2005-02-20 01:04:46 +0000
committerWayne Davison <wayned@samba.org>2005-02-20 01:04:46 +0000
commit9981c27ef1ebc3844a646392fc1c52416af699ca (patch)
tree87aa1c989b8b4493093108e2abe1565ceff51a75 /io.c
parentfe96018750bb6bbb16a0001a1056b2557be30f58 (diff)
downloadandroid_external_rsync-9981c27ef1ebc3844a646392fc1c52416af699ca.tar.gz
android_external_rsync-9981c27ef1ebc3844a646392fc1c52416af699ca.tar.bz2
android_external_rsync-9981c27ef1ebc3844a646392fc1c52416af699ca.zip
Handle the new MSG_SUCCESS message for both the generator and the
sender.
Diffstat (limited to 'io.c')
-rw-r--r--io.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/io.c b/io.c
index f01353ff..7e02d348 100644
--- a/io.c
+++ b/io.c
@@ -256,6 +256,14 @@ static void read_msg_fd(void)
read_loop(fd, buf, len);
io_multiplex_write(MSG_DELETED, buf, len);
break;
+ case MSG_SUCCESS:
+ if (len != 4 || !am_generator) {
+ rprintf(FERROR, "invalid message %d:%d\n", tag, len);
+ exit_cleanup(RERR_STREAMIO);
+ }
+ read_loop(fd, buf, len);
+ io_multiplex_write(MSG_SUCCESS, buf, len);
+ break;
case MSG_INFO:
case MSG_ERROR:
case MSG_LOG:
@@ -704,6 +712,16 @@ static int readfd_unbuffered(int fd, char *buf, size_t len)
log_delete(line, S_IFREG);
remaining = 0;
break;
+ case MSG_SUCCESS:
+ if (remaining != 4) {
+ rprintf(FERROR, "invalid multi-message %d:%ld\n",
+ tag, (long)remaining);
+ exit_cleanup(RERR_STREAMIO);
+ }
+ read_loop(fd, line, remaining);
+ successful_send(IVAL(line, 0));
+ remaining = 0;
+ break;
case MSG_INFO:
case MSG_ERROR:
if (remaining >= sizeof line) {