carterkozak commented on a change in pull request #207:
URL: 
https://github.com/apache/httpcomponents-core/pull/207#discussion_r461660914



##########
File path: 
httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/DefaultBHttpClientConnection.java
##########
@@ -157,8 +156,8 @@ public void sendRequestEntity(final ClassicHttpRequest 
request) throws HttpExcep
         try (final OutputStream outStream = createContentOutputStream(
                 len, this.outbuffer, new OutputStream() {
 
-                    final boolean ssl = socketHolder.getSocket() instanceof 
SSLSocket;
                     final InputStream socketInputStream = 
socketHolder.getInputStream();
+                    final boolean earlyResponseCheckRequiresRead = 
!(socketInputStream instanceof FileInputStream);

Review comment:
       I agree, unfortunately I'm not aware of a better way. In the worst case 
if the InputStream is wrapped we will fall back to the read-with-1ms-timeout 
approach that we're confident works correctly everywhere, but on older (LTS) 
JREs we may incur a the performance penalty. Since this uses the result of 
Socket.getInputStream directly in the cases I've tested, it does preserve the 
existing behavior where that works correctly.
   
   This also fixes the issue when a custom jsse provider is applied (Conscrypt, 
for example with `setUseEngineSocketByDefault(true)`) even on older java 
versions.




----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to