8278326: Socket close is not thread safe and other cleanup

Reviewed-by: jpai
This commit is contained in:
Alan Bateman 2023-01-12 09:38:31 +00:00
parent 036c80844e
commit 4b573343a6
5 changed files with 835 additions and 232 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2023, 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
@ -124,8 +124,8 @@ import java.util.Set;
// close the original socket impl and release its descriptor
close();
// update the Sockets impl to the impl from the http Socket
SocketImpl si = httpSocket.impl;
// change Socket to use httpSocket's SocketImpl
SocketImpl si = httpSocket.impl();
socket.setImpl(si);
// best effort is made to try and reset options previously set