337898 set client HttpConnection max idle time from exchange timeout

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2821 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Greg Wilkins 2011-02-23 00:15:56 +00:00
parent 8480cbdf97
commit 1070476469
3 changed files with 8 additions and 3 deletions

View File

@ -16,7 +16,7 @@ jetty-7.3.1-SNAPSHOT
+ 337784 Improve HashSessionManager for session migrations
+ 337878 Extra tests of security constraints
+ 337896 HttpExchange.timeout does not override HttpClient.timeout
+ 337898 increase client test timeout
+ 337898 set client HttpConnection max idle time from exchange timeout
+ JETTY-1331 Allow alternate XML configuration processors (eg spring)
+ JETTY-1335 HttpClient's SelectConnector clean-up

View File

@ -135,6 +135,8 @@ public class HttpConnection implements Connection
long exchTimeout = _exchange.getTimeout();
if (exchTimeout > 0)
{
if (exchTimeout!=_destination.getHttpClient().getTimeout())
_endp.setMaxIdleTime((int)exchTimeout);
_destination.getHttpClient().schedule(_timeout, exchTimeout);
}
else
@ -352,7 +354,10 @@ public class HttpConnection implements Connection
{
HttpExchange exchange=_exchange;
_exchange.disassociate();
if (_exchange.getTimeout()>0 && _exchange.getTimeout()!=getDestination().getHttpClient().getTimeout())
_endp.setMaxIdleTime((int)getDestination().getHttpClient().getTimeout());
_exchange = null;
if (_status==HttpStatus.SWITCHING_PROTOCOLS_101)
{

View File

@ -145,7 +145,7 @@ public class TimeoutExchangeTest
@Test
public void testExchangeTimeoutNotExpiring() throws Exception
{
startClient(2000);
startClient(500);
long serverSleep = 1000;
long exchangeTimeout = 1500;
@ -165,7 +165,7 @@ public class TimeoutExchangeTest
@Test
public void testExchangeTimeoutExpiring() throws Exception
{
startClient(2000);
startClient(5000);
long serverSleep = 1000;
long exchangeTimeout = 500;