]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
When using --iconv, if a server-side receiver can't convert a filename,
authorWayne Davison <wayned@samba.org>
Sat, 2 Aug 2008 17:26:17 +0000 (10:26 -0700)
committerWayne Davison <wayned@samba.org>
Sat, 2 Aug 2008 17:26:17 +0000 (10:26 -0700)
it now outputs the name back to the client without mangling the charset.

flist.c
io.c
log.c
rsync.h

diff --git a/flist.c b/flist.c
index 061d1be6ffd0576cdc0ef6ce5bc1dc19b4fb9374..d7f095d413d4f6fb457a4b714a9f3d3e7e3a860f 100644 (file)
--- a/flist.c
+++ b/flist.c
@@ -696,7 +696,7 @@ static struct file_struct *recv_file_entry(struct file_list *flist,
 
                if (iconvbufs(ic_recv, &inbuf, &outbuf, 0) < 0) {
                        io_error |= IOERR_GENERAL;
-                       rprintf(FERROR_XFER,
+                       rprintf(FERROR_UTF8,
                            "[%s] cannot convert filename: %s (%s)\n",
                            who_am_i(), lastname, strerror(errno));
                        outbuf.len = 0;
diff --git a/io.c b/io.c
index fe9bcec1d4a47d68dfb8288ae1848d1085d379c8..2756b1480ee8b5ac5cb9b5de1fa1035fe22f4012 100644 (file)
--- a/io.c
+++ b/io.c
@@ -454,6 +454,7 @@ static void read_msg_fd(void)
                got_flist_entry_status(FES_NO_SEND, buf);
                break;
        case MSG_ERROR_SOCKET:
+       case MSG_ERROR_UTF8:
        case MSG_CLIENT:
                if (!am_generator)
                        goto invalid_msg;
diff --git a/log.c b/log.c
index 13c9311dad3ab7eaaa140dddd51f4115e604c21d..609f3a58964fffc007f075ccaacdf6d9bd52320d 100644 (file)
--- a/log.c
+++ b/log.c
@@ -263,13 +263,17 @@ void rwrite(enum logcode code, const char *buf, int len, int is_utf8)
 
        if (am_server && msg_fd_out >= 0) {
                assert(!is_utf8);
-               /* Pass the message to our sibling. */
+               /* Pass the message to our sibling in native charset. */
                send_msg((enum msgcode)code, buf, len, 0);
                return;
        }
 
        if (code == FERROR_SOCKET) /* This gets simplified for a non-sibling. */
                code = FERROR;
+       else if (code == FERROR_UTF8) {
+               is_utf8 = 1;
+               code = FERROR;
+       }
 
        if (code == FCLIENT)
                code = FINFO;
diff --git a/rsync.h b/rsync.h
index c487d46e8a566f96a163d3d007242b88e1fa62fb..320d340ce1e3939a405cc04f52e463a6eb1b20c9 100644 (file)
--- a/rsync.h
+++ b/rsync.h
@@ -211,6 +211,7 @@ enum logcode {
     FERROR_XFER=1, FINFO=2, /* sent over socket for any protocol */
     FERROR=3, FWARNING=4, /* sent over socket for protocols >= 30 */
     FERROR_SOCKET=5, FLOG=6, /* only sent via receiver -> generator pipe */
+    FERROR_UTF8=8, /* only sent via receiver -> generator pipe */
     FCLIENT=7 /* never transmitted (e.g. server converts to FINFO) */
 };
 
@@ -221,6 +222,7 @@ enum msgcode {
        MSG_ERROR_XFER=FERROR_XFER, MSG_INFO=FINFO, /* remote logging */
        MSG_ERROR=FERROR, MSG_WARNING=FWARNING, /* protocol-30 remote logging */
        MSG_ERROR_SOCKET=FERROR_SOCKET, /* sibling logging */
+       MSG_ERROR_UTF8=FERROR_UTF8, /* sibling logging */
        MSG_LOG=FLOG, MSG_CLIENT=FCLIENT, /* sibling logging */
        MSG_REDO=9,     /* reprocess indicated flist index */
        MSG_FLIST=20,   /* extra file list over sibling socket */