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>
Tue, 17 Aug 2010 12:01:41 +0000 (14:01 +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 57d91493bd024c38eb5a54edd2acaeea46666f5f..7fea3394223d7a24d800def47b07d01f332ebcd4 100644 (file)
@@ -2347,6 +2347,8 @@ static void smbd_echo_reader(struct tevent_context *ev,
        bool ok;
        bool encrypted = false;
 
+       smb_msleep(1000);
+
        ok = smbd_lock_socket(sconn);
        if (!ok) {
                DEBUG(0, ("%s: failed to lock socket\n",