You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (JIRA)" <ji...@apache.org> on 2007/12/13 16:47:43 UTC

[jira] Updated: (HTTPCLIENT-717) NPE in SimpleHttpConnectionManager.shutdown()

     [ https://issues.apache.org/jira/browse/HTTPCLIENT-717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski updated HTTPCLIENT-717:
-----------------------------------------

    Fix Version/s: 3.1.1

> NPE in SimpleHttpConnectionManager.shutdown()
> ---------------------------------------------
>
>                 Key: HTTPCLIENT-717
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-717
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 3.1 Final
>            Reporter: Sebb
>             Fix For: 3.1.1
>
>
> SimpleHttpConnectionManager.shutdown() causes NPE if no connection has been created, whereas MultiThreadedHttpConnectionManager.shutdown() does not.
> Simple test case:
> 	MultiThreadedHttpConnectionManager cm = new MultiThreadedHttpConnectionManager();
> 	cm.shutdown(); // OK
> 		
> 	SimpleHttpConnectionManager sm = new SimpleHttpConnectionManager();
> 	sm.shutdown(); // NPE
> I came across this in JMeter - a sample was using Post with AutoRedirect, which (correctly) caused an IllegalArgumentException, and so the connection was not created. 
> The JMeter code could try to keep track of this, but it would be tedious, and it seems to me that SimpleHttpConnectionManager should ignore the shutdown() if the connection is null.
> The problem does not arise when using closeIdleConnections(timeout) - unless one uses the special value:
>       closeIdleConnections(System.currentTimeMillis() - Long.MAX_VALUE)
> but it would probably be sensible to protect against this as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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