[jira] Created: (ABDERA-248) MediaResponseContext#writeTo fails to close input stream after writing

View: New views
4 Messages — Rating Filter:   Alert me  

[jira] Created: (ABDERA-248) MediaResponseContext#writeTo fails to close input stream after writing

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

MediaResponseContext#writeTo fails to close input stream after writing
----------------------------------------------------------------------

                 Key: ABDERA-248
                 URL: https://issues.apache.org/jira/browse/ABDERA-248
             Project: Abdera
          Issue Type: Bug
    Affects Versions: 1.0
            Reporter: Daniel Lichtenberger


MediaResponseContext#writeTo fully consumes the input stream, but does not close it afterwards. Looking at the source, I also didn't find another place where the input stream was closed, potentially leaving an open input stream for every media response.

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


[jira] Commented: (ABDERA-248) MediaResponseContext#writeTo fails to close input stream after writing

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/ABDERA-248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754050#action_12754050 ]

Felix Meschberger commented on ABDERA-248:
------------------------------------------

From the peanut gallery not knowing any code: Shouldn't closing the stream be the task of the caller ?

I assume writeTo reads the stream until being notified to have reached the end of the input, which need not necessarily be the real end. Consider for example reading a ZIP entry from a ZipInputStream.

> MediaResponseContext#writeTo fails to close input stream after writing
> ----------------------------------------------------------------------
>
>                 Key: ABDERA-248
>                 URL: https://issues.apache.org/jira/browse/ABDERA-248
>             Project: Abdera
>          Issue Type: Bug
>    Affects Versions: 1.0
>            Reporter: Daniel Lichtenberger
>
> MediaResponseContext#writeTo fully consumes the input stream, but does not close it afterwards. Looking at the source, I also didn't find another place where the input stream was closed, potentially leaving an open input stream for every media response.

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


[jira] Commented: (ABDERA-248) MediaResponseContext#writeTo fails to close input stream after writing

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/ABDERA-248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754053#action_12754053 ]

Daniel Lichtenberger commented on ABDERA-248:
---------------------------------------------

Well, the client in my case is the AbderaServlet calling context.writeTo(response.getOutputStream()), and AbderaServlet doesn't know about any wrapped streams in the ResponseContext.

I'm not familiar with the Abdera source code, so I don't know whether ResponseContext#writeTo should always close the input stream or the caller (AbderaServlet) should call a close method on the ResponseContext to allow releasing resources at the end of a request.

> MediaResponseContext#writeTo fails to close input stream after writing
> ----------------------------------------------------------------------
>
>                 Key: ABDERA-248
>                 URL: https://issues.apache.org/jira/browse/ABDERA-248
>             Project: Abdera
>          Issue Type: Bug
>    Affects Versions: 1.0
>            Reporter: Daniel Lichtenberger
>
> MediaResponseContext#writeTo fully consumes the input stream, but does not close it afterwards. Looking at the source, I also didn't find another place where the input stream was closed, potentially leaving an open input stream for every media response.

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


[jira] Commented: (ABDERA-248) MediaResponseContext#writeTo fails to close input stream after writing

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/ABDERA-248?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12754055#action_12754055 ]

Felix Meschberger commented on ABDERA-248:
------------------------------------------

Oops, this was probably too far above in the peanut gallery and I confused input with output.....

You are right: if the context is creating/getting/acquiring the input, it has to make sure it is closed.

> MediaResponseContext#writeTo fails to close input stream after writing
> ----------------------------------------------------------------------
>
>                 Key: ABDERA-248
>                 URL: https://issues.apache.org/jira/browse/ABDERA-248
>             Project: Abdera
>          Issue Type: Bug
>    Affects Versions: 1.0
>            Reporter: Daniel Lichtenberger
>
> MediaResponseContext#writeTo fully consumes the input stream, but does not close it afterwards. Looking at the source, I also didn't find another place where the input stream was closed, potentially leaving an open input stream for every media response.

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