- Made an overflow in read_vstring() return an error instead of dying.
authorWayne Davison <wayned@samba.org>
Wed, 9 Mar 2005 18:54:02 +0000 (18:54 +0000)
committerWayne Davison <wayned@samba.org>
Wed, 9 Mar 2005 18:54:02 +0000 (18:54 +0000)
- Got rid of a flush kluge that was needed for the name-pipe.

io.c

diff --git a/io.c b/io.c
index 1650073..2321666 100644 (file)
--- a/io.c
+++ b/io.c
@@ -888,7 +888,7 @@ int read_vstring(int f, char *buf, int bufsize)
        if (len >= bufsize) {
                rprintf(FERROR, "over-long vstring received (%d > %d)\n",
                        len, bufsize - 1);
        if (len >= bufsize) {
                rprintf(FERROR, "over-long vstring received (%d > %d)\n",
                        len, bufsize - 1);
-               exit_cleanup(RERR_PROTOCOL);
+               return -1;
        }
 
        if (len)
        }
 
        if (len)
@@ -1045,14 +1045,8 @@ static void writefd_unbuffered(int fd,char *buf,size_t len)
                if (msg_fd_in >= 0 && FD_ISSET(msg_fd_in, &r_fds))
                        read_msg_fd();
 
                if (msg_fd_in >= 0 && FD_ISSET(msg_fd_in, &r_fds))
                        read_msg_fd();
 
-               if (!FD_ISSET(fd, &w_fds)) {
-                       if (fd != sock_f_out && iobuf_out_cnt) {
-                               no_flush--;
-                               io_flush(NORMAL_FLUSH);
-                               no_flush++;
-                       }
+               if (!FD_ISSET(fd, &w_fds))
                        continue;
                        continue;
-               }
 
                n = len - total;
                if (bwlimit && n > bwlimit_writemax)
 
                n = len - total;
                if (bwlimit && n > bwlimit_writemax)