mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8297211: Expensive fillInStackTrace operation in HttpURLConnection.getOutputStream0 when no content-length in response
Reviewed-by: simonis, dfuchs
This commit is contained in:
parent
5a45c25151
commit
392ac7055d
2 changed files with 25 additions and 16 deletions
|
@ -1932,9 +1932,12 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
|
|||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
cl = Long.parseLong(responses.findValue("content-length"));
|
||||
} catch (Exception exc) { };
|
||||
final String contentLengthVal = responses.findValue("content-length");
|
||||
if (contentLengthVal != null) {
|
||||
try {
|
||||
cl = Long.parseLong(contentLengthVal);
|
||||
} catch (NumberFormatException nfe) { }
|
||||
}
|
||||
|
||||
if (method.equals("HEAD") || cl == 0 ||
|
||||
respCode == HTTP_NOT_MODIFIED ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue