r17107: Make the 200 ms timeout value tunable in local.h...
authorJeremy Allison <jra@samba.org>
Tue, 18 Jul 2006 01:20:26 +0000 (01:20 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:38:12 +0000 (11:38 -0500)
Might need to be a parameter ?
Jeremy.
(This used to be commit 98d8d9399bb287319578daaf2a2fb42f3c48f858)

source3/include/local.h
source3/smbd/reply.c

index fb9319763626363d55027df410a0f6b9ecbef4e3..6d32f4fe6e9a5b404017196ab461b5e018152254 100644 (file)
 /* Default hash size for the winbindd cache. */
 #define WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE 5000
 
+/* Windows minimum lock resolution timeout in ms */
+#define WINDOWS_MINIMUM_LOCK_TIMEOUT_MS 200
+
 #endif
index bb7991867536f8a9ee27c3dc05a859f2d578b138..f1ac098e7d14045f8e169e3c4b1c73fec404afca 100644 (file)
@@ -5383,8 +5383,8 @@ int reply_lockingX(connection_struct *conn, char *inbuf, char *outbuf,
                        if (br_lck && blocking_lock && ERROR_WAS_LOCK_DENIED(status)) {
                                /* Windows internal resolution for blocking locks seems
                                   to be about 200ms... Don't wait for less than that. JRA. */
-                               if (lock_timeout != -1 && lock_timeout < 200) {
-                                       lock_timeout = 200;
+                               if (lock_timeout != -1 && lock_timeout < WINDOWS_MINIMUM_LOCK_TIMEOUT_MS) {
+                                       lock_timeout = WINDOWS_MINIMUM_LOCK_TIMEOUT_MS;
                                }
                                defer_lock = True;
                        }
@@ -5397,7 +5397,7 @@ int reply_lockingX(connection_struct *conn, char *inbuf, char *outbuf,
                        if (br_lck && lp_blocking_locks(SNUM(conn)) && !blocking_lock &&
                                        NT_STATUS_EQUAL((status), NT_STATUS_FILE_LOCK_CONFLICT)) {
                                defer_lock = True;
-                               lock_timeout = 200;
+                               lock_timeout = WINDOWS_MINIMUM_LOCK_TIMEOUT_MS;
                        }
 
                        if (br_lck && defer_lock) {