You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Dave Brosius (JIRA)" <ji...@apache.org> on 2008/06/09 19:11:00 UTC

[jira] Created: (CAMEL-595) [patch] make sure file read code, reads fully

[patch] make sure file read code, reads fully
---------------------------------------------

                 Key: CAMEL-595
                 URL: https://issues.apache.org/activemq/browse/CAMEL-595
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 1.3.0
            Reporter: Dave Brosius
            Priority: Trivial
             Fix For: 1.4.0
         Attachments: read_fully.patch

code uses in.read(buf) assuming that the read will be greedy. This isn't guaranteed, Patch fixes this.

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


[jira] Issue Comment Edited: (CAMEL-595) [patch] make sure file read code, reads fully

Posted by "Dave Brosius (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43350#action_43350 ] 

dbrosius edited comment on CAMEL-595 at 6/9/08 12:34 PM:
-------------------------------------------------------------

It's not guaranteed by the InputStream contract. Some streams may greedy read, others may not. Large streams are a likely cause. I believe it's up to each platform to decide how to manage this, so it might be that unix and win32 work perfectly fine, but perhaps some smaller platform does not. I didn't notice any other places in the code that has this problem. 

      was (Author: dbrosius):
    It's not guaranteed by the InputStream contract. Some streams may greedy read, others may not. Large streams are a likely cause. I didn't notice any other places in the code that has this problem. 
  
> [patch] make sure file read code, reads fully
> ---------------------------------------------
>
>                 Key: CAMEL-595
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-595
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Dave Brosius
>            Priority: Trivial
>             Fix For: 1.4.0
>
>         Attachments: read_fully.patch
>
>
> code uses in.read(buf) assuming that the read will be greedy. This isn't guaranteed, Patch fixes this.

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


[jira] Resolved: (CAMEL-595) [patch] make sure file read code, reads fully

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-595.
-------------------------------

    Resolution: Fixed

Thanks Dave for all your patches. Great that you take the time to dig into the code and find these. Please keep em coming -. I will fire up to svn commit command ;)

> [patch] make sure file read code, reads fully
> ---------------------------------------------
>
>                 Key: CAMEL-595
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-595
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Dave Brosius
>            Assignee: Claus Ibsen
>            Priority: Trivial
>             Fix For: 1.4.0
>
>         Attachments: read_fully.patch
>
>
> code uses in.read(buf) assuming that the read will be greedy. This isn't guaranteed, Patch fixes this.

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


[jira] Commented: (CAMEL-595) [patch] make sure file read code, reads fully

Posted by "Dave Brosius (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43350#action_43350 ] 

Dave Brosius commented on CAMEL-595:
------------------------------------

It's not guaranteed by the InputStream contract. Some streams may greedy read, others may not. Large streams are a likely cause. I didn't notice any other places in the code that has this problem. 

> [patch] make sure file read code, reads fully
> ---------------------------------------------
>
>                 Key: CAMEL-595
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-595
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Dave Brosius
>            Priority: Trivial
>             Fix For: 1.4.0
>
>         Attachments: read_fully.patch
>
>
> code uses in.read(buf) assuming that the read will be greedy. This isn't guaranteed, Patch fixes this.

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


[jira] Commented: (CAMEL-595) [patch] make sure file read code, reads fully

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43349#action_43349 ] 

Claus Ibsen commented on CAMEL-595:
-----------------------------------

Dave thanks for all the findings. Is there other places in the code that have similiar issues with the read?, could be in some of the components as well.

However I haven't seen this kind of code to properly handling reading from an inputsource to a buffer not done with the just the one-liners in.read(buf) in other frameworks.
I don't think its well know that this problem could exists that the buffer isn't read in one operation.

Dave do you have experience that this has happened? eg reading a very large file etc?

> [patch] make sure file read code, reads fully
> ---------------------------------------------
>
>                 Key: CAMEL-595
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-595
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Dave Brosius
>            Priority: Trivial
>             Fix For: 1.4.0
>
>         Attachments: read_fully.patch
>
>
> code uses in.read(buf) assuming that the read will be greedy. This isn't guaranteed, Patch fixes this.

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


[jira] Assigned: (CAMEL-595) [patch] make sure file read code, reads fully

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-595:
---------------------------------

    Assignee: Claus Ibsen

> [patch] make sure file read code, reads fully
> ---------------------------------------------
>
>                 Key: CAMEL-595
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-595
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Dave Brosius
>            Assignee: Claus Ibsen
>            Priority: Trivial
>             Fix For: 1.4.0
>
>         Attachments: read_fully.patch
>
>
> code uses in.read(buf) assuming that the read will be greedy. This isn't guaranteed, Patch fixes this.

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


[jira] Updated: (CAMEL-595) [patch] make sure file read code, reads fully

Posted by "Dave Brosius (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dave Brosius updated CAMEL-595:
-------------------------------

    Attachment: read_fully.patch

> [patch] make sure file read code, reads fully
> ---------------------------------------------
>
>                 Key: CAMEL-595
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-595
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Dave Brosius
>            Priority: Trivial
>             Fix For: 1.4.0
>
>         Attachments: read_fully.patch
>
>
> code uses in.read(buf) assuming that the read will be greedy. This isn't guaranteed, Patch fixes this.

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


[jira] Issue Comment Edited: (CAMEL-595) [patch] make sure file read code, reads fully

Posted by "Dave Brosius (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43350#action_43350 ] 

dbrosius edited comment on CAMEL-595 at 6/9/08 12:34 PM:
-------------------------------------------------------------

It's not guaranteed by the InputStream contract. Some streams may greedy read, others may not. Large streams are a likely cause. For files, I believe it's up to each platform to decide how to manage this, so it might be that unix and win32 work perfectly fine, but perhaps some smaller platform does not. I didn't notice any other places in the code that has this problem. 

      was (Author: dbrosius):
    It's not guaranteed by the InputStream contract. Some streams may greedy read, others may not. Large streams are a likely cause. I believe it's up to each platform to decide how to manage this, so it might be that unix and win32 work perfectly fine, but perhaps some smaller platform does not. I didn't notice any other places in the code that has this problem. 
  
> [patch] make sure file read code, reads fully
> ---------------------------------------------
>
>                 Key: CAMEL-595
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-595
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 1.3.0
>            Reporter: Dave Brosius
>            Priority: Trivial
>             Fix For: 1.4.0
>
>         Attachments: read_fully.patch
>
>
> code uses in.read(buf) assuming that the read will be greedy. This isn't guaranteed, Patch fixes this.

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