You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Oliver Köll <ok...@newbase.de> on 2005/01/05 15:46:06 UTC

Stale connection checking broken in 3.0 beta 1

Hi,

today i tried to upgrade from 3.0a1 to 3.0b1 and ran into problems with 
stale connections throwing SocketExceptions on me (which did not happen 
  with alpha 1).

I think the problem for this can be found in HttpConnection:

   public boolean closeIfStale() throws IOException {
     if (used && isOpen && isStale()) {
       LOG.debug("Connection is stale, closing...");
       close();
       return true;
     }
     return false;
   }

staleness is only checked if used = true, but there is no code in 
HttpConnection that sets the used flag. In other words: used is always 
false and isStale() is never called.

Cheers, Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Re: Stale connection checking broken in 3.0 beta 1

Posted by Oleg Kalnichevski <ol...@apache.org>.
Auch. Please file a bug report with Bugzilla and i'll get it fixed as
soon as I can.

Thanks for tracking down the problem

Oleg


On Wed, Jan 05, 2005 at 03:46:06PM +0100, Oliver K?ll wrote:
> Hi,
> 
> today i tried to upgrade from 3.0a1 to 3.0b1 and ran into problems with 
> stale connections throwing SocketExceptions on me (which did not happen 
>  with alpha 1).
> 
> I think the problem for this can be found in HttpConnection:
> 
>   public boolean closeIfStale() throws IOException {
>     if (used && isOpen && isStale()) {
>       LOG.debug("Connection is stale, closing...");
>       close();
>       return true;
>     }
>     return false;
>   }
> 
> staleness is only checked if used = true, but there is no code in 
> HttpConnection that sets the used flag. In other words: used is always 
> false and isStale() is never called.
> 
> Cheers, Oliver
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org