s3: Reduce the load on the echo handler
authorVolker Lendecke <vl@samba.org>
Thu, 12 Aug 2010 10:55:11 +0000 (12:55 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 12 Aug 2010 11:32:16 +0000 (13:32 +0200)
If the parent is fast enough, the echo handler should not step in. When the
socket becomes readable, the echo handler goes to sleep for a second. If within
that second, the parent has picked up the SMB request from the net, the echo
handler will just go back to select().

source3/smbd/process.c

index ea9fb1c5c072062d2c18e661037376dbe4ca4395..adfcad1bdc515ea623f1ad76027b3041b07b9686 100644 (file)
@@ -2671,6 +2671,8 @@ static void smbd_echo_reader(struct tevent_context *ev,
        bool ok;
        bool encrypted = false;
 
+       smb_msleep(1000);
+
        ok = smbd_lock_socket_internal(sconn);
        if (!ok) {
                DEBUG(0, ("%s: failed to lock socket\n",