From: Dave B. <bla...@us...> - 2013-08-20 12:10:55
|
Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/http In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv12619/src/org/sblim/cimclient/internal/http Modified Files: HttpClient.java Log Message: 2654 Check jcc idle time with CIMOM keepalive timeout to avoid EOF Index: HttpClient.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/internal/http/HttpClient.java,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- HttpClient.java 30 May 2013 13:10:35 -0000 1.48 +++ HttpClient.java 20 Aug 2013 12:10:53 -0000 1.49 @@ -71,6 +71,7 @@ * 2621 2013-02-23 blaschke-oss Not all chunked input has trailers * 2618 2013-02-27 blaschke-oss Need to add property to disable weak cipher suites for the secure indication * 2642 2013-05-21 blaschke-oss Seperate properties needed for cim client and listener to filter out ciphers + * 2654 2013-07-29 blaschke-oss Check jcc idle time with CIMOM keepalive timeout to avoid EOF */ package org.sblim.cimclient.internal.http; @@ -551,6 +552,29 @@ logger.trace(Level.FINER, "Attempting http request (retry counters:" + IoRetry + "/" + AuthentificationRetry + ")"); long RequestTime = System.currentTimeMillis(); + + if (this.iPreviousResponseTime != -1) { + long time = RequestTime - this.iPreviousResponseTime; + long maxTime = this.iHttpClientPool.getConfigurationContext() + .getSocketIdleTimeout(); + if (maxTime > 0 && time > maxTime) { + logger.trace(Level.FINER, "Closing socket after " + time + + "ms of idle time"); + + if (this.iSocket != null && !this.iSocket.isClosed()) { + try { + this.iSocket.close(); + } catch (IOException e) { + logger.trace(Level.FINER, + "Exception caught while closing socket", e); + } + } + this.iSocket = null; + this.iReset = true; + this.iResponse = null; + } + } + ResponseTime = -1; resetSocket(); this.iReset = false; |