summaryrefslogtreecommitdiff
path: root/source4/lib/util_sock.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-09-25 11:15:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:12 -0500
commit30381686c4874e4f9602a977a31399e49350e597 (patch)
tree5dd22bab490fc75070a7d5a713cecbc57dd6eef4 /source4/lib/util_sock.c
parent045543b661c1ee2c1dac72203e634b9a08568081 (diff)
downloadsamba-30381686c4874e4f9602a977a31399e49350e597.tar.gz
samba-30381686c4874e4f9602a977a31399e49350e597.tar.bz2
samba-30381686c4874e4f9602a977a31399e49350e597.zip
r2621: - 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 (This used to be commit e73b4ae4e500d3b7ee57e160e0f8b63c99b2542a)
Diffstat (limited to 'source4/lib/util_sock.c')
-rw-r--r--source4/lib/util_sock.c73
1 files changed, 0 insertions, 73 deletions
diff --git a/source4/lib/util_sock.c b/source4/lib/util_sock.c
index f24d010f22..387c72599a 100644
--- a/source4/lib/util_sock.c
+++ b/source4/lib/util_sock.c
@@ -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.
@@ -349,20 +290,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.
****************************************************************************/
int open_socket_in( int type, int port, int dlevel, uint32_t socket_addr, BOOL rebind )