diff options
author | nelsonb%netscape.com <devnull@localhost> | 2001-06-22 03:38:05 +0000 |
---|---|---|
committer | nelsonb%netscape.com <devnull@localhost> | 2001-06-22 03:38:05 +0000 |
commit | 9398633147790fe824cf88134f219f2cbc2f9f15 (patch) | |
tree | b2a03c4c7f6a5ab63c2c344593be537fc8ff00fe /security | |
parent | 3b0163abc950ef3a71e13f5b80e0551c8b66dc61 (diff) | |
download | nss-hg-9398633147790fe824cf88134f219f2cbc2f9f15.tar.gz |
The environment variable NSS_SSL_SERVER_CACHE_MUTEX_TIMEOUT specifies
the maximum amount of time to wait before recovering a session cache
mutex (semaphore) from a dead process on Unix.
Diffstat (limited to 'security')
-rw-r--r-- | security/nss/lib/ssl/sslsnce.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/security/nss/lib/ssl/sslsnce.c b/security/nss/lib/ssl/sslsnce.c index cea3b32c4..9100d740b 100644 --- a/security/nss/lib/ssl/sslsnce.c +++ b/security/nss/lib/ssl/sslsnce.c @@ -1276,20 +1276,32 @@ LockPoller(void * arg) cacheDesc * cache = (cacheDesc *)arg; cacheDesc * sharedCache = cache->sharedCache; sidCacheLock * pLock; + const char * timeoutString; PRIntervalTime timeout; PRUint32 now; PRUint32 then; int locks_polled = 0; int locks_to_poll = cache->numSIDCacheLocks + 2; + PRUint32 expiration = SID_LOCK_EXPIRATION_TIMEOUT; + + timeoutString = getenv("NSS_SSL_SERVER_CACHE_MUTEX_TIMEOUT"); + if (timeoutString) { + long newTime = strtol(timeoutString, 0, 0); + if (newTime == 0) + return; /* application doesn't want this function */ + if (newTime > 0) + expiration = (PRUint32)newTime; + /* if error (newTime < 0) ignore it and use default */ + } - timeout = PR_SecondsToInterval(SID_LOCK_EXPIRATION_TIMEOUT); + timeout = PR_SecondsToInterval(expiration); while(!sharedCache->stopPolling) { PR_Sleep(timeout); if (sharedCache->stopPolling) break; now = ssl_Time(); - then = now - SID_LOCK_EXPIRATION_TIMEOUT; + then = now - expiration; for (pLock = cache->sidCacheLocks, locks_polled = 0; locks_to_poll > locks_polled && !sharedCache->stopPolling; ++locks_polled, ++pLock ) { |