aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2004-01-16 16:31:47 +0000
committerWayne Davison <wayned@samba.org>2004-01-16 16:31:47 +0000
commit13c7bcbb2be2fc580af0ade159c2b85c4e3cd3b0 (patch)
tree3b61e70c02dafd3fb8c6f3d25aa252dfd3dd1e13 /io.c
parentd48c8065600389843f4586cf82a171f15ea86d20 (diff)
downloadandroid_external_rsync-13c7bcbb2be2fc580af0ade159c2b85c4e3cd3b0.tar.gz
android_external_rsync-13c7bcbb2be2fc580af0ade159c2b85c4e3cd3b0.tar.bz2
android_external_rsync-13c7bcbb2be2fc580af0ade159c2b85c4e3cd3b0.zip
Output an error before we die if we get a wacko message from the receiver.
Diffstat (limited to 'io.c')
-rw-r--r--io.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/io.c b/io.c
index 7bb3b088..38386b69 100644
--- a/io.c
+++ b/io.c
@@ -208,13 +208,17 @@ static void read_msg_fd(void)
switch (tag) {
case MSG_DONE:
- if (len != 0)
+ if (len != 0) {
+ rprintf(FERROR, "invalid message %d:%d\n", tag, len);
exit_cleanup(RERR_STREAMIO);
+ }
redo_list_add(-1);
break;
case MSG_REDO:
- if (len != 4)
+ if (len != 4) {
+ rprintf(FERROR, "invalid message %d:%d\n", tag, len);
exit_cleanup(RERR_STREAMIO);
+ }
read_loop(fd, buf, 4);
redo_list_add(IVAL(buf,0));
break;
@@ -231,6 +235,7 @@ static void read_msg_fd(void)
}
break;
default:
+ rprintf(FERROR, "unknown message %d:%d\n", tag, len);
exit_cleanup(RERR_STREAMIO);
}