release lock on client side cache bad hash

This commit is contained in:
toddouska 2014-12-01 14:11:32 -08:00
parent 1742e0ddb6
commit 4954043def

View File

@ -5777,8 +5777,7 @@ int AddSession(CYASSL* ssl)
&error) % SESSION_ROWS; &error) % SESSION_ROWS;
if (error != 0) { if (error != 0) {
CYASSL_MSG("Hash session failed"); CYASSL_MSG("Hash session failed");
return error; } else {
}
clientIdx = ClientCache[clientRow].nextIdx++; clientIdx = ClientCache[clientRow].nextIdx++;
ClientCache[clientRow].Clients[clientIdx].serverRow = (word16)row; ClientCache[clientRow].Clients[clientIdx].serverRow = (word16)row;
@ -5788,6 +5787,7 @@ int AddSession(CYASSL* ssl)
if (ClientCache[clientRow].nextIdx == SESSIONS_PER_ROW) if (ClientCache[clientRow].nextIdx == SESSIONS_PER_ROW)
ClientCache[clientRow].nextIdx = 0; ClientCache[clientRow].nextIdx = 0;
} }
}
else else
SessionCache[row].Sessions[idx].idLen = 0; SessionCache[row].Sessions[idx].idLen = 0;
#endif /* NO_CLIENT_CACHE */ #endif /* NO_CLIENT_CACHE */
@ -5795,7 +5795,7 @@ int AddSession(CYASSL* ssl)
if (UnLockMutex(&session_mutex) != 0) if (UnLockMutex(&session_mutex) != 0)
return BAD_MUTEX_E; return BAD_MUTEX_E;
return 0; return error;
} }