mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8282617: sun.net.www.protocol.https.HttpsClient#putInKeepAliveCache() doesn't use a lock while dealing with "inCache" field
Reviewed-by: dfuchs, michaelm
This commit is contained in:
parent
bc42e7cbbf
commit
974ef5542f
1 changed files with 11 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -661,12 +661,17 @@ final class HttpsClient extends HttpClient
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void putInKeepAliveCache() {
|
protected void putInKeepAliveCache() {
|
||||||
|
lock();
|
||||||
|
try {
|
||||||
if (inCache) {
|
if (inCache) {
|
||||||
assert false : "Duplicate put to keep alive cache";
|
assert false : "Duplicate put to keep alive cache";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
inCache = true;
|
inCache = true;
|
||||||
kac.put(url, sslSocketFactory, this);
|
kac.put(url, sslSocketFactory, this);
|
||||||
|
} finally {
|
||||||
|
unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue