Merge pull request #7078 from douzzer/20231218-AddSessionToClientCache-round-2

20231218-AddSessionToClientCache-round-2
This commit is contained in:
philljj
2023-12-18 13:15:52 -06:00
committed by GitHub

View File

@@ -14409,19 +14409,19 @@ ClientSession* AddSessionToClientCache(int side, int row, int idx, byte* serverI
} }
if (error == 0) { if (error == 0) {
WOLFSSL_MSG("Adding client cache entry"); WOLFSSL_MSG("Adding client cache entry");
ret = &ClientCache[clientRow].Clients[clientIdx];
if (ClientCache[clientRow].totalCount < CLIENT_SESSIONS_PER_ROW) if (ClientCache[clientRow].totalCount < CLIENT_SESSIONS_PER_ROW)
ClientCache[clientRow].totalCount++; ClientCache[clientRow].totalCount++;
ClientCache[clientRow].nextIdx++; ClientCache[clientRow].nextIdx++;
ClientCache[clientRow].nextIdx %= CLIENT_SESSIONS_PER_ROW; ClientCache[clientRow].nextIdx %= CLIENT_SESSIONS_PER_ROW;
} }
ret = &ClientCache[clientRow].Clients[clientIdx];
wc_UnLockMutex(&clisession_mutex); wc_UnLockMutex(&clisession_mutex);
} }
else { else {
WOLFSSL_MSG("Hash session or lock failed"); WOLFSSL_MSG("Hash session or lock failed");
error = -1;
} }
} }
else { else {