r20700: In the main processing loop we select() on the fam socket. If it fires, it
authorVolker Lendecke <vlendec@samba.org>
Fri, 12 Jan 2007 09:29:44 +0000 (09:29 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:17:04 +0000 (12:17 -0500)
might be possible that we hang in the receive_smb() although that socket is
not the reason for the select() to return.

This immediately reacts to the fam socket to become readable, and goes into
the select loop again. This fixes delays in files showing up in Windows.

Jeremy, James please review this and merge to 3_0_24 if appropriate.

Thanks,

Volker

source/smbd/process.c

index 28c2cd65dd2fbe2253818c333b347ffd5c9d855b..ecb33453c56ed8f82826040b6f4b699c0efd00c1 100644 (file)
@@ -514,6 +514,19 @@ static BOOL receive_message_or_smb(char *buffer, int buffer_len, int timeout)
                 */
                goto again;
        }
+
+       if ((change_notify_fd() >= 0) && FD_ISSET(change_notify_fd(), &fds)) {
+
+               process_pending_change_notify_queue((time_t)0);
+
+               /*
+                * Same comment as for oplock processing applies here. We
+                * might have done I/O on the client socket.
+                */
+
+               goto again;
+       }
+
        
        return receive_smb(smbd_server_fd(), buffer, 0);
 }