cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "roey sagie (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-3520) download progress report 200%
Date Tue, 28 May 2013 08:40:20 GMT

    [ 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

Mime
View raw message