forked from wolfSSL/wolfssl
only reset session cache with lock
This commit is contained in:
@ -2628,6 +2628,7 @@ int CyaSSL_restore_session_cache(const char *fname)
|
||||
ret = (int)XFREAD(SessionCache + i, sizeof(SessionRow), 1, file);
|
||||
if (ret != 1) {
|
||||
CYASSL_MSG("Session cache member file read failed");
|
||||
XMEMSET(SessionCache, 0, sizeof SessionCache);
|
||||
rc = FREAD_ERROR;
|
||||
break;
|
||||
}
|
||||
@ -2635,9 +2636,6 @@ int CyaSSL_restore_session_cache(const char *fname)
|
||||
|
||||
UnLockMutex(&session_mutex);
|
||||
|
||||
if (rc != SSL_SUCCESS)
|
||||
XMEMSET(SessionCache, 0, sizeof SessionCache);
|
||||
|
||||
XFCLOSE(file);
|
||||
CYASSL_LEAVE("CyaSSL_restore_session_cache", rc);
|
||||
|
||||
|
Reference in New Issue
Block a user