summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ambach <christian.ambach@de.ibm.com>2011-02-22 15:45:44 +0100
committerVolker Lendecke <vlendec@samba.org>2011-02-23 16:51:03 +0100
commit051611256b043a8841c456ce34a37ef4ac806155 (patch)
tree4f498f873cce7abf474fa10a2cf2497b7993fb1a
parentdfd33bcbb81998e68c00d2a01aab6b5c468ecf87 (diff)
downloadsamba-051611256b043a8841c456ce34a37ef4ac806155.tar.gz
samba-051611256b043a8841c456ce34a37ef4ac806155.tar.bz2
samba-051611256b043a8841c456ce34a37ef4ac806155.zip
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 <vlendec@samba.org> Autobuild-Date: Wed Feb 23 16:51:03 CET 2011 on sn-devel-104
-rw-r--r--source3/libsmb/clientgen.c19
1 files changed, 12 insertions, 7 deletions
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;
}