damn!
authorAndrew Tridgell <tridge@samba.org>
Sat, 29 Jan 2000 04:50:01 +0000 (04:50 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sat, 29 Jan 2000 04:50:01 +0000 (04:50 +0000)
the last pre-release had a bug that didn't setup the multiplexing
correctly. This means that pre-release will get "unexpected tag -7"
whenm talking to the fixed code.

io.c
log.c
main.c

diff --git a/io.c b/io.c
index f948147..540ef2a 100644 (file)
--- a/io.c
+++ b/io.c
@@ -407,8 +407,8 @@ static void mplex_write(int fd, enum logcode code, char *buf, int len)
 
        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);
@@ -417,7 +417,9 @@ static void mplex_write(int fd, enum logcode code, char *buf, int len)
        len -= n;
        buf += n;
 
-       writefd_unbuffered(fd, buf, len);
+       if (len) {
+               writefd_unbuffered(fd, buf, len);
+       }
 }
 
 
diff --git a/log.c b/log.c
index f0ee10e..427bdc3 100644 (file)
--- a/log.c
+++ b/log.c
@@ -94,7 +94,7 @@ void rwrite(enum logcode code, char *buf, int 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);
 
@@ -105,7 +105,13 @@ void rwrite(enum logcode code, char *buf, int len)
                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;
@@ -117,9 +123,7 @@ void rwrite(enum logcode code, char *buf, int len)
                depth++;
 
                log_open();
-               if (!io_multiplex_write(code, buf, strlen(buf))) {
-                       logit(priority, buf);
-               }
+               logit(priority, buf);
 
                depth--;
                return;
diff --git a/main.c b/main.c
index 2a5597e..914ab24 100644 (file)
--- a/main.c
+++ b/main.c
@@ -393,11 +393,11 @@ void start_server(int f_in, int f_out, int argc, char *argv[])
        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)
@@ -418,10 +418,10 @@ int client_run(int f_in, int f_out, int pid, int argc, char *argv[])
        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;