r2621: - now that the client code is non-blocking, we no longer need
authorAndrew Tridgell <tridge@samba.org>
Sat, 25 Sep 2004 11:15:18 +0000 (11:15 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:59:12 +0000 (12:59 -0500)
  write_data and read_data, which are inherently blocking operations

- got rid of some old NBT keepalive routines that are not needed
(This used to be commit e73b4ae4e500d3b7ee57e160e0f8b63c99b2542a)

source4/auth/auth_server.c
source4/lib/util_sock.c
source4/libcli/raw/clisocket.c

index d66415b525db0c8c19e388e3a73de94e2f34c183..be272e625cacaf8635da6c0172e223578b1691fa 100644 (file)
@@ -144,24 +144,6 @@ static void free_server_private_data(void **private_data_pointer)
        }
 }
 
-/****************************************************************************
- Send a 'keepalive' packet down the cli pipe.
-****************************************************************************/
-
-static void send_server_keepalive(void **private_data_pointer) 
-{
-       struct smbcli_state **cli = (struct smbcli_state **)private_data_pointer;
-       
-       /* also send a keepalive to the password server if its still
-          connected */
-       if (cli && *cli && (*cli)->initialised) {
-               if (!send_nbt_keepalive((*cli)->fd)) {
-                       DEBUG( 2, ( "password server keepalive failed.\n"));
-                       smbcli_shutdown(*cli);
-               }
-       }
-}
-
 /****************************************************************************
  Get the challenge out of a password server.
 ****************************************************************************/
index f24d010f225692d77cb098f309d18a6e4f666be2..387c72599a280a81c58f62210a5a731f2847276c 100644 (file)
@@ -179,65 +179,6 @@ ssize_t read_udp_socket(int fd, char *buf, size_t len,
 }
 
 
-/****************************************************************************
-  read data from the client, reading exactly N bytes. 
-****************************************************************************/
-ssize_t read_data(int fd, char *buffer, size_t N)
-{
-       ssize_t ret;
-       size_t total=0;  
-       if (fd == -1) {
-               errno = EIO;
-               return -1;
-       }
-
-       while (total < N) {
-               ret = sys_read(fd,buffer + total,N - total);
-               if (ret == 0) {
-                       return total;
-               }
-               if (ret == -1) {
-                       if (total == 0) {
-                               return -1;
-                       }
-                       return total;
-               }
-               total += ret;
-       }
-       return (ssize_t)total;
-}
-
-
-/****************************************************************************
- Write data to a fd.
-****************************************************************************/
-ssize_t write_data(int fd, const char *buffer, size_t N)
-{
-       size_t total=0;
-       ssize_t ret;
-
-       if (fd == -1) {
-               errno = EIO;
-               return -1;
-       }
-
-       while (total < N) {
-               ret = sys_write(fd, buffer + total, N - total);
-               if (ret == -1) {
-                       if (total == 0) {
-                               return -1;
-                       }
-                       return total;
-               }
-               if (ret == 0) {
-                       return total;
-               }
-
-               total += ret;
-       }
-       return (ssize_t)total;
-}
 
 /****************************************************************************
  Check the timeout. 
@@ -348,20 +289,6 @@ ssize_t write_data_until(int fd,char *buffer,size_t N,
 }
 
 
-/****************************************************************************
-send a keepalive packet (rfc1002)
-****************************************************************************/
-BOOL send_nbt_keepalive(int sock_fd)
-{
-       uint8_t buf[4];
-
-       buf[0] = SMBkeepalive;
-       buf[1] = buf[2] = buf[3] = 0;
-
-       return write_data(sock_fd,(char *)buf,4) == 4;
-}
-
-
 /****************************************************************************
  Open a socket of the specified type, port, and address for incoming data.
 ****************************************************************************/
index 9aea8624d002267c00afcccb3669424343c66089..654d8ee61be7b21552f76ff7fccacb58880c8c80 100644 (file)
@@ -125,7 +125,7 @@ ssize_t smbcli_sock_write(struct smbcli_socket *sock, const char *data, size_t l
                return -1;
        }
 
-       return write_data(sock->fd, data, len);
+       return write(sock->fd, data, len);
 }
 
 
@@ -139,7 +139,7 @@ ssize_t smbcli_sock_read(struct smbcli_socket *sock, char *data, size_t len)
                return -1;
        }
 
-       return read_data(sock->fd, data, len);
+       return read(sock->fd, data, len);
 }
 
 /****************************************************************************