svn commit: samba r2621 - in branches/SAMBA_4_0/source: auth lib
libcli/raw
tridge at samba.org
tridge at samba.org
Sat Sep 25 11:15:19 GMT 2004
Author: tridge
Date: 2004-09-25 11:15:18 +0000 (Sat, 25 Sep 2004)
New Revision: 2621
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=2621&nolog=1
Log:
- now that the client code is non-blocking, we no longer need
write_data and read_data, which are inherently blocking operations
- got rid of some old NBT keepalive routines that are not needed
Modified:
branches/SAMBA_4_0/source/auth/auth_server.c
branches/SAMBA_4_0/source/lib/util_sock.c
branches/SAMBA_4_0/source/libcli/raw/clisocket.c
Changeset:
Modified: branches/SAMBA_4_0/source/auth/auth_server.c
===================================================================
--- branches/SAMBA_4_0/source/auth/auth_server.c 2004-09-25 10:12:54 UTC (rev 2620)
+++ branches/SAMBA_4_0/source/auth/auth_server.c 2004-09-25 11:15:18 UTC (rev 2621)
@@ -145,24 +145,6 @@
}
/****************************************************************************
- 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.
****************************************************************************/
Modified: branches/SAMBA_4_0/source/lib/util_sock.c
===================================================================
--- branches/SAMBA_4_0/source/lib/util_sock.c 2004-09-25 10:12:54 UTC (rev 2620)
+++ branches/SAMBA_4_0/source/lib/util_sock.c 2004-09-25 11:15:18 UTC (rev 2621)
@@ -179,67 +179,8 @@
}
-/****************************************************************************
- 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.
****************************************************************************/
@@ -349,20 +290,6 @@
/****************************************************************************
-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.
****************************************************************************/
int open_socket_in( int type, int port, int dlevel, uint32_t socket_addr, BOOL rebind )
Modified: branches/SAMBA_4_0/source/libcli/raw/clisocket.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/raw/clisocket.c 2004-09-25 10:12:54 UTC (rev 2620)
+++ branches/SAMBA_4_0/source/libcli/raw/clisocket.c 2004-09-25 11:15:18 UTC (rev 2621)
@@ -125,7 +125,7 @@
return -1;
}
- return write_data(sock->fd, data, len);
+ return write(sock->fd, data, len);
}
@@ -139,7 +139,7 @@
return -1;
}
- return read_data(sock->fd, data, len);
+ return read(sock->fd, data, len);
}
/****************************************************************************
More information about the samba-cvs
mailing list