ffang commented on code in PR #3673:
URL: https://github.com/apache/cxf/pull/3673#discussion_r4516005130


##########
rt/transports/http/src/main/java/org/apache/cxf/transport/http/HttpClientHTTPConduit.java:
##########
@@ -470,10 +584,16 @@ protected void setupConnection(Message message, Address 
address, HTTPClientPolic
             initializationLock.lock();
             try {
                 cl = clientRef;
+                if (cl == null && !httpsReset) {
+                    // switching back to the settings of a client this conduit 
has used before
+                    cl = takeDeferredClient(clientPolicy, 
clientParametersCopy);

Review Comment:
   Thanks @reta, agreed, it's not worth it. I removed `reusableClientRefs` and 
the take-back, so the conduit always gets its client from the cache again 
(ee17d34f9c).
   
   With sharing on, which is the default, switching back to earlier settings 
gets the same shared client from the cache anyway. The conduit now keeps a 
single reference to it, so switching back and forth no longer grows the queue 
of clients released on `close()`.
   
   With sharing off, a conduit whose settings keep changing builds a new client 
each time, released on `close()`. That's how the HTTPS reset with sharing off 
already works on main, so I've left it as it is.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to