babyblue94520 opened a new pull request, #645:
URL: https://github.com/apache/tomcat/pull/645
__HttpClient__ judges how many connections are cached by the __keepalive__
header max value, but __Http11Processor__ doesn't provide it, so __HttpClient__
__keepAliveConnections__ is always __5__.
## sun.net.www.http.HttpClient
Parse keepalive headers for max connections.
* __parseHTTPHeader__
```java
HeaderParser p = new HeaderParser(responses.findValue("Keep-Alive"));
/* default should be larger in case of proxy */
keepAliveConnections = p.findInt("max", usingProxy?50:5);
keepAliveTimeout = p.findInt("timeout", usingProxy?60:5);
```
* __finished__
```java
public void finished() {
if (reuse) /* will be reused */
return;
keepAliveConnections--;
poster = null;
if (keepAliveConnections > 0 && isKeepingAlive() &&
!(serverOutput.checkError())) {
/* This connection is keepingAlive && still valid.
* Return it to the cache.
*/
putInKeepAliveCache();
} else {
closeServer();
}
}
```
--
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]