summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2002-09-22 16:22:48 +0000
committerRichard Sharpe <sharpe@samba.org>2002-09-22 16:22:48 +0000
commit8aaf8174bf1efef402d46489d56ae759a70341b8 (patch)
tree893f7c53ad893f2ea4cff593769f911d6f7d5c53 /source3/libsmb
parentd06d2c876e3f295715e818fa6869d968e32b3dc4 (diff)
downloadsamba-8aaf8174bf1efef402d46489d56ae759a70341b8.tar.gz
samba-8aaf8174bf1efef402d46489d56ae759a70341b8.tar.bz2
samba-8aaf8174bf1efef402d46489d56ae759a70341b8.zip
Small, long overdue, fix for libsmbclient.
(This used to be commit 40aea3fe94b68ce284e2f21e57f086212936c049)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clientgen.c19
1 files changed, 19 insertions, 0 deletions
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;
+}
+