diff options
author | Richard Sharpe <sharpe@samba.org> | 2002-09-22 16:22:48 +0000 |
---|---|---|
committer | Richard Sharpe <sharpe@samba.org> | 2002-09-22 16:22:48 +0000 |
commit | 40aea3fe94b68ce284e2f21e57f086212936c049 (patch) | |
tree | f64da73fbbbd32d28b4185821b4ec9efd27434e1 /source | |
parent | 8c41b5cd1b8b0c2639def9552bd20b8aca39785c (diff) | |
download | samba-40aea3fe94b68ce284e2f21e57f086212936c049.tar.gz samba-40aea3fe94b68ce284e2f21e57f086212936c049.tar.xz samba-40aea3fe94b68ce284e2f21e57f086212936c049.zip |
Small, long overdue, fix for libsmbclient.
Diffstat (limited to 'source')
-rw-r--r-- | source/libsmb/clientgen.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/libsmb/clientgen.c b/source/libsmb/clientgen.c index 6b6a2acd3b8..793dd19644f 100644 --- a/source/libsmb/clientgen.c +++ b/source/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; +} + |