summaryrefslogtreecommitdiff
path: root/source3/utils/nmb-agent.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-12-04 20:43:45 +0000
committerLuke Leighton <lkcl@samba.org>1999-12-04 20:43:45 +0000
commit9b44e117f955872ae42dcd5eee128394ca4d9ccd (patch)
tree0b633db95d16dd2631365350ebe08c630b23c00d /source3/utils/nmb-agent.c
parent45032218520e2cc8763a84e900b9738417b9cdd5 (diff)
downloadsamba-9b44e117f955872ae42dcd5eee128394ca4d9ccd.tar.gz
samba-9b44e117f955872ae42dcd5eee128394ca4d9ccd.tar.bz2
samba-9b44e117f955872ae42dcd5eee128394ca4d9ccd.zip
more similar agent code
(This used to be commit 2c778313b8c2b4535f16e11aea81a61edb3b2d45)
Diffstat (limited to 'source3/utils/nmb-agent.c')
-rw-r--r--source3/utils/nmb-agent.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/source3/utils/nmb-agent.c b/source3/utils/nmb-agent.c
index 8a202d04fa..7e7b1642cb 100644
--- a/source3/utils/nmb-agent.c
+++ b/source3/utils/nmb-agent.c
@@ -44,8 +44,6 @@ struct sock_redir
int c_trn_id;
int s_trn_id;
struct nmb_state *n;
- time_t time;
-
};
static uint32 num_socks = 0;
@@ -138,7 +136,6 @@ static struct sock_redir *sock_redir_get(int fd)
sock->c = fd;
sock->s = -1;
sock->n = NULL;
- sock->time = time(NULL);
DEBUG(10,("sock_redir_get:\tfd:\t%d\t\n", fd));
@@ -234,7 +231,7 @@ static BOOL process_cli_sock(struct sock_redir **sock)
return True;
}
-static BOOL process_srv_sock(struct sock_redir *sock)
+static BOOL process_srv_sock(int fd)
{
int nmb_id;
int tr_id;
@@ -242,7 +239,7 @@ static BOOL process_srv_sock(struct sock_redir *sock)
struct packet_struct *p;
- p = receive_packet(sock->s, NMB_PACKET, 0);
+ p = receive_packet(fd, NMB_PACKET, 0);
if (p == NULL)
{
return False;
@@ -381,8 +378,6 @@ static void start_agent(void)
continue;
}
- DEBUG(10,("select received\n"));
-
if (FD_ISSET(s, &fds))
{
FD_CLR(s, &fds);
@@ -412,14 +407,14 @@ static void start_agent(void)
{
continue;
}
- if (socks[i]->s == -1)
+ if (socks[i]->n == NULL)
{
continue;
}
if (FD_ISSET(socks[i]->s, &fds))
{
FD_CLR(socks[i]->s, &fds);
- if (!process_srv_sock(socks[i]))
+ if (!process_srv_sock(socks[i]->s))
{
sock_redir_free(socks[i]);
socks[i] = NULL;
@@ -429,9 +424,9 @@ static void start_agent(void)
}
}
-/**************************************************************************** **
+/******************************************************************************
open the socket communication
- **************************************************************************** */
+ *****************************************************************************/
static BOOL open_sockets(BOOL isdaemon, int port)
{
/* The sockets opened here will be used to receive broadcast