зеркало из https://github.com/mozilla/gecko-dev.git
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.
This commit is contained in:
Родитель
a80663f1ca
Коммит
7aef7b8c79
|
@ -32,7 +32,7 @@
|
||||||
* may use your version of this file under either the MPL or the
|
* may use your version of this file under either the MPL or the
|
||||||
* GPL.
|
* GPL.
|
||||||
*
|
*
|
||||||
* $Id: sslsnce.c,v 1.12 2001/06/12 20:27:12 nelsonb%netscape.com Exp $
|
* $Id: sslsnce.c,v 1.13 2001/06/22 03:38:05 nelsonb%netscape.com Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Note: ssl_FreeSID() in sslnonce.c gets used for both client and server
|
/* Note: ssl_FreeSID() in sslnonce.c gets used for both client and server
|
||||||
|
@ -1276,20 +1276,32 @@ LockPoller(void * arg)
|
||||||
cacheDesc * cache = (cacheDesc *)arg;
|
cacheDesc * cache = (cacheDesc *)arg;
|
||||||
cacheDesc * sharedCache = cache->sharedCache;
|
cacheDesc * sharedCache = cache->sharedCache;
|
||||||
sidCacheLock * pLock;
|
sidCacheLock * pLock;
|
||||||
|
const char * timeoutString;
|
||||||
PRIntervalTime timeout;
|
PRIntervalTime timeout;
|
||||||
PRUint32 now;
|
PRUint32 now;
|
||||||
PRUint32 then;
|
PRUint32 then;
|
||||||
int locks_polled = 0;
|
int locks_polled = 0;
|
||||||
int locks_to_poll = cache->numSIDCacheLocks + 2;
|
int locks_to_poll = cache->numSIDCacheLocks + 2;
|
||||||
|
PRUint32 expiration = SID_LOCK_EXPIRATION_TIMEOUT;
|
||||||
|
|
||||||
timeout = PR_SecondsToInterval(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(expiration);
|
||||||
while(!sharedCache->stopPolling) {
|
while(!sharedCache->stopPolling) {
|
||||||
PR_Sleep(timeout);
|
PR_Sleep(timeout);
|
||||||
if (sharedCache->stopPolling)
|
if (sharedCache->stopPolling)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
now = ssl_Time();
|
now = ssl_Time();
|
||||||
then = now - SID_LOCK_EXPIRATION_TIMEOUT;
|
then = now - expiration;
|
||||||
for (pLock = cache->sidCacheLocks, locks_polled = 0;
|
for (pLock = cache->sidCacheLocks, locks_polled = 0;
|
||||||
locks_to_poll > locks_polled && !sharedCache->stopPolling;
|
locks_to_poll > locks_polled && !sharedCache->stopPolling;
|
||||||
++locks_polled, ++pLock ) {
|
++locks_polled, ++pLock ) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче