mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8236464: SO_LINGER option is ignored by SSLSocket in JDK 11
Reviewed-by: ascarpino
This commit is contained in:
parent
88f3861cb7
commit
bfcb340606
2 changed files with 42 additions and 37 deletions
|
@ -619,6 +619,15 @@ public final class SSLSocketImpl
|
|||
}
|
||||
}
|
||||
|
||||
// Deliver the user_canceled alert and the close notify alert.
|
||||
closeNotify(useUserCanceled);
|
||||
|
||||
if (!isInputShutdown()) {
|
||||
bruteForceCloseInput(hasCloseReceipt);
|
||||
}
|
||||
}
|
||||
|
||||
void closeNotify(boolean useUserCanceled) throws IOException {
|
||||
// Need a lock here so that the user_canceled alert and the
|
||||
// close_notify alert can be delivered together.
|
||||
int linger = getSoLinger();
|
||||
|
@ -633,7 +642,7 @@ public final class SSLSocketImpl
|
|||
conContext.outputRecord.recordLock.tryLock(
|
||||
linger, TimeUnit.SECONDS)) {
|
||||
try {
|
||||
handleClosedNotifyAlert(useUserCanceled);
|
||||
deliverClosedNotify(useUserCanceled);
|
||||
} finally {
|
||||
conContext.outputRecord.recordLock.unlock();
|
||||
}
|
||||
|
@ -687,18 +696,14 @@ public final class SSLSocketImpl
|
|||
} else {
|
||||
conContext.outputRecord.recordLock.lock();
|
||||
try {
|
||||
handleClosedNotifyAlert(useUserCanceled);
|
||||
deliverClosedNotify(useUserCanceled);
|
||||
} finally {
|
||||
conContext.outputRecord.recordLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
if (!isInputShutdown()) {
|
||||
bruteForceCloseInput(hasCloseReceipt);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleClosedNotifyAlert(
|
||||
private void deliverClosedNotify(
|
||||
boolean useUserCanceled) throws IOException {
|
||||
try {
|
||||
// send a user_canceled alert if needed.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue