When using --iconv, if a server-side receiver can't convert a filename,

it now outputs the name back to the client without mangling the charset.
This commit is contained in:
Wayne Davison
2008-08-02 10:25:17 -07:00
parent aef51b4c68
commit fc088e30c8
5 changed files with 12 additions and 2 deletions

3
NEWS
View File

@@ -28,6 +28,9 @@ Changes since 3.0.3:
- When using --iconv, if a filename fails to convert on the receiving side,
this no longer interferes with deletions in the root-dir of the transfer.
- When using --iconv, if a server-side receiver can't convert a filename,
it now outputs the name back to the client without mangling the charset.
- Fixed a bug where --delete-during could delete in a directory before it
noticed that the sending side sent an I/O error for that directory.

View File

@@ -678,7 +678,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;

1
io.c
View File

@@ -455,6 +455,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;

6
log.c
View File

@@ -257,13 +257,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;

View File

@@ -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 */