bug 1373068 - fix the ctypes declaration of SSL_ClearSessionCache in head_psm.js r=Cykesiopka

SSL_ClearSessionCache is `void SSL_ClearSessionCache()`. In head_psm.js it was
being declared as `SECStatus SSL_ClearSessionCache()` and the "return value" was
being checked, which was incorrect. This apparently wasn't causing failures on
any of our test runs, but with tsan enabled the check would fail.

MozReview-Commit-ID: 6KosOVPu8K4

--HG--
extra : rebase_source : 73addb80a5ab5263a182207a0f4277daf8ae32a5
This commit is contained in:
David Keeler 2017-06-14 15:10:28 -07:00
parent 26a0f65229
commit 0b2a439e7e

View File

@ -238,15 +238,18 @@ function clearSessionCache() {
let SSL_ClearSessionCache = null;
try {
SSL_ClearSessionCache =
_getLibraryFunctionWithNoArguments("SSL_ClearSessionCache", "ssl3");
_getLibraryFunctionWithNoArguments("SSL_ClearSessionCache", "ssl3",
ctypes.void_t);
} catch (e) {
// On Windows, this is actually in the nss3 library.
SSL_ClearSessionCache =
_getLibraryFunctionWithNoArguments("SSL_ClearSessionCache", "nss3");
_getLibraryFunctionWithNoArguments("SSL_ClearSessionCache", "nss3",
ctypes.void_t);
}
if (!SSL_ClearSessionCache || SSL_ClearSessionCache() != 0) {
throw new Error("Failed to clear SSL session cache");
if (!SSL_ClearSessionCache) {
throw new Error("couldn't get SSL_ClearSessionCache");
}
SSL_ClearSessionCache();
}
function getSSLStatistics() {