You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by "James M Snell (JIRA)" <ji...@apache.org> on 2007/07/13 08:16:04 UTC

[jira] Resolved: (ABDERA-49) AutoReleasingInputStream leaks connections in case of error

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

James M Snell resolved ABDERA-49.
---------------------------------

    Resolution: Fixed

Fixed

> AutoReleasingInputStream leaks connections in case of error
> -----------------------------------------------------------
>
>                 Key: ABDERA-49
>                 URL: https://issues.apache.org/jira/browse/ABDERA-49
>             Project: Abdera
>          Issue Type: Bug
>    Affects Versions: 0.2.2
>            Reporter: Ugo Cei
>            Assignee: Ugo Cei
>            Priority: Critical
>             Fix For: 0.3.0
>
>
> If an exception occurs when reading from an AutoReleasingInputStream, the connection won't be closed, leading to a leak. The implementation of the method should be
>   public int read() throws IOException {
>       try {
>           int r = super.read();
>           if (r == -1) method.releaseConnection();
>           return r;
>       } catch (IOException e) {
>           method.releaseConnection();
>           throw e;
>       }
>   }
> Same for read(byte[] b, int off, int len).

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