mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8291637: HttpClient default keep alive timeout not followed if server sends invalid value
Reviewed-by: jpai, dfuchs
This commit is contained in:
parent
0da4314e95
commit
b17a745d7f
2 changed files with 147 additions and 0 deletions
|
@ -900,7 +900,15 @@ public class HttpClient extends NetworkClient {
|
|||
responses.findValue("Keep-Alive"));
|
||||
/* default should be larger in case of proxy */
|
||||
keepAliveConnections = p.findInt("max", usingProxy?50:5);
|
||||
if (keepAliveConnections < 0) {
|
||||
keepAliveConnections = usingProxy?50:5;
|
||||
}
|
||||
keepAliveTimeout = p.findInt("timeout", -1);
|
||||
if (keepAliveTimeout < -1) {
|
||||
// if the server specified a negative (invalid) value
|
||||
// then we set to -1, which is equivalent to no value
|
||||
keepAliveTimeout = -1;
|
||||
}
|
||||
}
|
||||
} else if (b[7] != '0') {
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue