SIVAL(buffer, 0, ((MPLEX_BASE + (int)code)<<24) + len);
- if (n > (sizeof(buf)-4)) {
- n = sizeof(buf)-4;
+ if (n > (sizeof(buffer)-4)) {
+ n = sizeof(buffer)-4;
}
memcpy(&buffer[4], buf, n);
len -= n;
buf += n;
- writefd_unbuffered(fd, buf, len);
+ if (len) {
+ writefd_unbuffered(fd, buf, len);
+ }
}
extern int quiet;
/* recursion can happen with certain fatal conditions */
- if (quiet != 0 && code == FINFO) return;
+ if (quiet && code == FINFO) return;
if (len < 0) exit_cleanup(RERR_MESSAGEIO);
return;
}
- if (io_error_write(log_error_fd, code, buf, strlen(buf))) return;
+ if (io_error_write(log_error_fd, code, buf, strlen(buf))) {
+ return;
+ }
+
+ if (io_multiplex_write(code, buf, strlen(buf))) {
+ return;
+ }
if (am_daemon) {
static int depth;
depth++;
log_open();
- if (!io_multiplex_write(code, buf, strlen(buf))) {
- logit(priority, buf);
- }
+ logit(priority, buf);
depth--;
return;
extern int am_sender;
extern int remote_version;
+ setup_protocol(f_out, f_in);
+
if (remote_version >= 23)
io_start_multiplex_out(f_out);
- setup_protocol(f_out, f_in);
-
if (am_sender) {
recv_exclude_list(f_in);
if (cvs_exclude)
extern int list_only;
extern int remote_version;
+ setup_protocol(f_out,f_in);
+
if (remote_version >= 23)
io_start_multiplex_in(f_in);
-
- setup_protocol(f_out,f_in);
if (am_sender) {
extern int cvs_exclude;