You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2017/09/12 09:57:00 UTC

[jira] [Resolved] (CAMEL-11672) Input stream infinitive loop

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

Claus Ibsen resolved CAMEL-11672.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 2.20.0

Copying streams in IOHelper from came-core now regard EOL of data if the first read byte is zero to work around issues on some application servers like IBM WebSphere. This can be turned off by setting JVM system property "camel.zeroByteEOLEnabled=false".

> Input stream infinitive loop
> ----------------------------
>
>                 Key: CAMEL-11672
>                 URL: https://issues.apache.org/jira/browse/CAMEL-11672
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-http
>    Affects Versions: 2.12.4
>         Environment: IBM Websphere Liberty Core 17.0.0.1
> IBM Websphere Liberty Core 17.0.0.2
> Reproducible using both IBM JDK 8 and Oracle JDK 8
>            Reporter: Zeljko Vukovic
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.20.0
>
>
> Dear Camel team,
> While working on one integration we found issue related to camel-http component when solution is deployed on IBM Liberty core.
> Same issue is not reproducible on Jetty and Tomcat.
> Issue is connected to the code in IOHelper and CachedOutputStream$WrappedInputStream
> We are using version 2.12.4 but I can see that same code is used also in latest versions.
> https://github.com/apache/camel/blob/camel-2.12.4/camel-core/src/main/java/org/apache/camel/util/IOHelper.java
> Problematic part are lines 196, 198 and 204.
> Basically stream reader which is used org.apache.camel.converter.stream.CachedOutputStream$WrappedInputStream is not returning -1 like response of read method if empty string is provided on input.
> This is wrong by specification of InputReader interface.
>        // in the case there is input which is empty string
>        while ( -1 != n) {
>          …
>          int n = input.read(buffer);  ---> this is never -1 if string is empty "" already 0 and we have infinitive loop !!!
>         }
>  
> For our use case we have applied change in IOHelper to check and directly cover if stream reader produce same (non-valid) response to not produce infinitive loop.
> If any questions around reproducing issue please let me know
> Best regards,
> Zeljko



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)