saxenapranav commented on code in PR #6022:
URL: https://github.com/apache/hadoop/pull/6022#discussion_r1317175881


##########
hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/services/AbfsHttpOperation.java:
##########
@@ -391,6 +398,23 @@ public void processResponse(final byte[] buffer, final int 
offset, final int len
 
     this.statusDescription = getConnResponseMessage();
 
+    /*

Review Comment:
   In case of expect-100 error:
   ProtocolException is raised: 
https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java#L1364.
   Caught by getOutputStream0(), we do: 
https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java#L1488-L1493
 -> wherein the responseCode is in object field.
   
   In case of `getResponseCode`: it checks if the field is != -1. If yes, it 
returns the responseCode it has else, go via getInputStream route: 
https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/net/HttpURLConnection.java#L520-L522.
 Here we have it in the field and is not -1.
   
   In case of `getResponseMessage()`, its kind of a getter. It internally calls 
`getResponseCode()`: 
https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/net/HttpURLConnection.java#L596-L599.
   
   Hence, these two methods are safe.



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


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

Reply via email to