+ case MSG_NOOP:
+ if (am_sender)
+ maybe_send_keepalive();
+ break;
+ case MSG_IO_ERROR:
+ if (msg_bytes != 4)
+ goto invalid_msg;
+ read_loop(fd, line, msg_bytes);
+ io_error |= IVAL(line, 0);
+ break;
+ case MSG_DELETED:
+ if (msg_bytes >= sizeof line)
+ goto overflow;
+#ifdef ICONV_OPTION
+ if (ic_recv != (iconv_t)-1) {
+ ICONV_CONST char *ibuf;
+ char *obuf = line;
+ size_t icnt, ocnt = sizeof line - 1;
+ int add_null = 0;
+ iconv(ic_send, NULL, 0, NULL, 0);
+ while (msg_bytes) {
+ icnt = msg_bytes > sizeof iconv_buf
+ ? sizeof iconv_buf : msg_bytes;
+ read_loop(fd, iconv_buf, icnt);
+ if (!(msg_bytes -= icnt) && !iconv_buf[icnt-1])
+ icnt--, add_null = 1;
+ ibuf = (ICONV_CONST char *)iconv_buf;
+ if (iconv(ic_send, &ibuf,&icnt,
+ &obuf,&ocnt) == (size_t)-1)
+ goto overflow; // XXX
+ }
+ if (add_null)
+ *obuf++ = '\0';
+ msg_bytes = obuf - line;
+ } else
+#endif
+ read_loop(fd, line, msg_bytes);
+ /* A directory name was sent with the trailing null */
+ if (msg_bytes > 0 && !line[msg_bytes-1])
+ log_delete(line, S_IFDIR);
+ else {
+ line[msg_bytes] = '\0';
+ log_delete(line, S_IFREG);
+ }
+ break;
+ case MSG_SUCCESS:
+ if (msg_bytes != 4) {
+ invalid_msg:
+ rprintf(FERROR, "invalid multi-message %d:%ld [%s]\n",
+ tag, (long)msg_bytes, who_am_i());
+ exit_cleanup(RERR_STREAMIO);
+ }
+ read_loop(fd, line, msg_bytes);
+ successful_send(IVAL(line, 0));
+ break;
+ case MSG_NO_SEND:
+ if (msg_bytes != 4)
+ goto invalid_msg;
+ read_loop(fd, line, msg_bytes);
+ send_msg_int(MSG_NO_SEND, IVAL(line, 0));
+ break;