From 051611256b043a8841c456ce34a37ef4ac806155 Mon Sep 17 00:00:00 2001 From: Christian Ambach Date: Tue, 22 Feb 2011 15:45:44 +0100 Subject: s3:libsmb only log a dead connection if it was not closed in case the cli was closed before (e.g. via a dropped ip message) it can be expected that the read here returns with an error and so we should not log that a connection is dead when it was closed before Autobuild-User: Volker Lendecke Autobuild-Date: Wed Feb 23 16:51:03 CET 2011 on sn-devel-104 --- source3/libsmb/clientgen.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'source3/libsmb') diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index 3816419dfd..e26c1718d8 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -248,13 +248,18 @@ bool cli_receive_smb(struct cli_state *cli) /* If the server is not responding, note that now */ if (len < 0) { - char addr[INET6_ADDRSTRLEN]; - - print_sockaddr(addr, sizeof(addr), &cli->dest_ss); - DEBUG(0, ("Receiving SMB: Server %s stopped responding\n", - addr)); - close(cli->fd); - cli->fd = -1; + /* + * only log if the connection should still be open and not when + * the connection was closed due to a dropped ip message + */ + if (cli->fd != -1) { + char addr[INET6_ADDRSTRLEN]; + print_sockaddr(addr, sizeof(addr), &cli->dest_ss); + DEBUG(0, ("Receiving SMB: Server %s stopped responding\n", + addr)); + close(cli->fd); + cli->fd = -1; + } return false; } -- cgit