don't retrieve or cache null sessions

This commit is contained in:
toddouska
2012-05-17 10:55:42 -07:00
parent e5953ce6f6
commit 4b8ab62bd1
3 changed files with 13 additions and 4 deletions

View File

@@ -2572,7 +2572,10 @@ CYASSL_SESSION* GetSession(CYASSL* ssl, byte* masterSecret)
int idx;
if (ssl->options.sessionCacheOff)
return 0;
return NULL;
if (ssl->options.haveSessionId == 0)
return NULL;
row = HashSession(id) % SESSION_ROWS;
@@ -2635,6 +2638,9 @@ int AddSession(CYASSL* ssl)
if (ssl->options.sessionCacheOff)
return 0;
if (ssl->options.haveSessionId == 0)
return 0;
row = HashSession(ssl->arrays.sessionID) % SESSION_ROWS;
if (LockMutex(&session_mutex) != 0)