r11978: Volker's fix for #3292 (smbclient spins if server terminates
authorJeremy Allison <jra@samba.org>
Wed, 30 Nov 2005 17:56:50 +0000 (17:56 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:05:41 +0000 (11:05 -0500)
connection).
Jeremy.
(This used to be commit 9b8602e0551500916a9d79c317589cd82d3da111)

source3/client/client.c

index 7a4f853d543c82f6023463830f1bf37679579d7a..f95bbea6718a78dced5fd252014ca30ee767889e 100644 (file)
@@ -3084,7 +3084,11 @@ static void readline_callback(void)
           session keepalives and then drop them here.
        */
        if (FD_ISSET(cli->fd,&fds)) {
-               receive_smb(cli->fd,cli->inbuf,0);
+               if (!receive_smb(cli->fd,cli->inbuf,0)) {
+                       DEBUG(0, ("Read from server failed, maybe it closed the "
+                               "connection\n"));
+                       return;
+               }
                goto again;
        }