mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +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.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -661,12 +661,17 @@ final class HttpsClient extends HttpClient
|
|||
|
||||
@Override
|
||||
protected void putInKeepAliveCache() {
|
||||
if (inCache) {
|
||||
assert false : "Duplicate put to keep alive cache";
|
||||
return;
|
||||
lock();
|
||||
try {
|
||||
if (inCache) {
|
||||
assert false : "Duplicate put to keep alive cache";
|
||||
return;
|
||||
}
|
||||
inCache = true;
|
||||
kac.put(url, sslSocketFactory, this);
|
||||
} finally {
|
||||
unlock();
|
||||
}
|
||||
inCache = true;
|
||||
kac.put(url, sslSocketFactory, this);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue