You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by "Michael Moser (JIRA)" <ji...@apache.org> on 2014/12/18 16:24:13 UTC

[jira] [Updated] (NIFI-181) ListenHTTP Max Data rate doesn't work due to bug in LeakyBucketStreamThrottler

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

Michael Moser updated NIFI-181:
-------------------------------
    Description: 
ListenHTTP throws ArrayIndexOutOfBoundsException when the property Max Data to Receive per Second is set.  This was traced to a bug in LeakyBucketStreamThrottler.

{code:title=commons/nifi-stream-utils/src/main/java/org/apache/nifi/io/LeakyBucketStreamThrottler.java Line 114}
            public int read(byte[] b, int off, int len) throws IOException {
+               if ( len < 0 ) {
+                   throw new IllegalArgumentException();
+               }
+               if ( len == 0 ) {
+                   return 0;
+               }
                baos.reset();
{code}

  was:
ListenHTTP throws ArrayIndexOutOfBoundsException when the property Max Data to Receive per Second is set.  This was traced to a bug in LeakyBucketStreamThrottler.

commons/nifi-stream-utils/src/main/java/org/apache/nifi/io/LeakyBucketStreamThrottler.java
Line 114:
            public int read(byte[] b, int off, int len) throws IOException {
+               if ( len < 0 ) {
+                   throw new IllegalArgumentException();
+               }
+               if ( len == 0 ) {
+                   return 0;
+               }
                baos.reset();


> ListenHTTP Max Data rate doesn't work due to bug in LeakyBucketStreamThrottler
> ------------------------------------------------------------------------------
>
>                 Key: NIFI-181
>                 URL: https://issues.apache.org/jira/browse/NIFI-181
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 0.0.1
>            Reporter: Michael Moser
>            Priority: Minor
>
> ListenHTTP throws ArrayIndexOutOfBoundsException when the property Max Data to Receive per Second is set.  This was traced to a bug in LeakyBucketStreamThrottler.
> {code:title=commons/nifi-stream-utils/src/main/java/org/apache/nifi/io/LeakyBucketStreamThrottler.java Line 114}
>             public int read(byte[] b, int off, int len) throws IOException {
> +               if ( len < 0 ) {
> +                   throw new IllegalArgumentException();
> +               }
> +               if ( len == 0 ) {
> +                   return 0;
> +               }
>                 baos.reset();
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)