From 8aaf8174bf1efef402d46489d56ae759a70341b8 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Sun, 22 Sep 2002 16:22:48 +0000 Subject: Small, long overdue, fix for libsmbclient. (This used to be commit 40aea3fe94b68ce284e2f21e57f086212936c049) --- source3/libsmb/clientgen.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source3/libsmb') diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index 6b6a2acd3b..793dd19644 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -328,3 +328,22 @@ uint16 cli_setpid(struct cli_state *cli, uint16 pid) cli->pid = pid; return ret; } + +/**************************************************************************** +Send a keepalive packet to the server +****************************************************************************/ +BOOL cli_send_keepalive(struct cli_state *cli) +{ + if (cli->fd == -1) { + DEBUG(3, ("cli_send_keepalive: fd == -1\n")); + return False; + } + if (!send_keepalive(cli->fd)) { + close(cli->fd); + cli->fd = -1; + DEBUG(0,("Error sending keepalive packet to client.\n")); + return False; + } + return True; +} + -- cgit