You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "roey sagie (JIRA)" <ji...@apache.org> on 2013/05/28 10:40:20 UTC

[jira] [Commented] (CB-3520) download progress report 200%

    [ https://issues.apache.org/jira/browse/CB-3520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13668182#comment-13668182 ] 

roey sagie commented on CB-3520:
--------------------------------

The updateBytesRead of the TrackingHTTPInputStream is called twice for each read(byte[] buffer).

The reason is the read(byte[] buffer) redirects to read(byte[] bytes, int offset, int count). http://ulibgcj.sourceforge.net/javadoc/java/io/FilterInputStream.html

The solution is simply to remove the read(byte[] buffer) implementation.

/* This function will call the read(byte[] bytes, int offset, int count) and the updateBytesRead will be called twice
   @Override
   public int read(byte[] buffer) throws IOException {
	return updateBytesRead(super.read(buffer);
   }
*/

                
> download progress report 200%
> -----------------------------
>
>                 Key: CB-3520
>                 URL: https://issues.apache.org/jira/browse/CB-3520
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.7.0
>         Environment: Android
>            Reporter: roey sagie
>            Assignee: Joe Bowser
>            Priority: Minor
>              Labels: fileTransfer,
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> When downloading a file from a server the progress report count each byte twice.
> The final result is 200% instead of 100%.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira