ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maarten Coene (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (IVY-930) HttpClientHandler hanging in certain cases
Date Wed, 01 Oct 2008 21:23:44 GMT

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

Maarten Coene resolved IVY-930.
-------------------------------

       Resolution: Fixed
    Fix Version/s: trunk

Thank you for reporting!

I've committed your (slighlty modified) patch into SVN trunk.
Please give it a try and post your feedback here.

> HttpClientHandler hanging in certain cases
> ------------------------------------------
>
>                 Key: IVY-930
>                 URL: https://issues.apache.org/jira/browse/IVY-930
>             Project: Ivy
>          Issue Type: Bug
>    Affects Versions: 2.0-RC1
>            Reporter: Scott Hebert
>            Assignee: Maarten Coene
>            Priority: Blocker
>             Fix For: trunk
>
>
> Using Commons HttpClient and an URL Resolver, it is possible for the HttpClientHandler
to hang.
> The following seems to correct the problem:
> {code:java}
>     public InputStream openStream(URL url) throws IOException {
>         GetMethod get = doGet(url);
>         if (!checkStatusCode(url, get)) {
> // Make sure the number of connections does not get exhausted
>             get.releaseConnection();
> //
>             throw new IOException(
>                     "The HTTP response code for " + url + " did not indicate a success."
>                             + " See log for more detail.");
>         }
>         return new GETInputStream(get);
>     }
>     public void download(URL src, File dest, CopyProgressListener l) throws IOException
{
>         GetMethod get = doGet(src);
>         // We can only figure the content we got is want we want if the status is success.
>         if (!checkStatusCode(src, get)) {
> // Make sure the number of connections does not get exhausted
>             get.releaseConnection();
> //
>             throw new IOException(
>                     "The HTTP response code for " + src + " did not indicate a success."
>                             + " See log for more detail.");
>         }
>         FileUtil.copy(get.getResponseBodyAsStream(), dest, l);
>         dest.setLastModified(getLastModified(get));
>         get.releaseConnection();
>     }
> {code}

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


Mime
View raw message