Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A8A6110B26 for ; Mon, 10 Feb 2014 23:26:58 +0000 (UTC) Received: (qmail 82291 invoked by uid 500); 10 Feb 2014 23:24:46 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 80604 invoked by uid 500); 10 Feb 2014 23:24:01 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 79645 invoked by uid 99); 10 Feb 2014 23:23:32 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Feb 2014 23:23:32 +0000 Date: Mon, 10 Feb 2014 23:23:32 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-5631) FileTransfer.download progress returns excatly twice as much loaded bytes on android MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-5631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13897226#comment-13897226 ] ASF subversion and git services commented on CB-5631: ----------------------------------------------------- Commit 8374b3dd67ecdb62423ff55ccb9d0a4454cfe4a4 in branch refs/heads/master from [~cdmahoney] [ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-file-transfer.git;h=8374b3d ] CB-5631 Removed SimpleTrackingInputStream.read(byte[] buffer) InputStream.read(byte[] buffer) calls InputStream.read(byte[] bytes, int offset, int count). As SimpleTrackingInputStream overrides both these methods a call to SimpleTrackingInputStream.read(byte[] buffer) results in a call to SimpleTrackingInputStream.read(byte[] bytes, int offset, int count) - and two calls to SimpleTrackingInputStream.updateBytesRead, so the counter bytesRead gets incremented twice for each read. > FileTransfer.download progress returns excatly twice as much loaded bytes on android > ------------------------------------------------------------------------------------ > > Key: CB-5631 > URL: https://issues.apache.org/jira/browse/CB-5631 > Project: Apache Cordova > Issue Type: Bug > Components: Android, Plugin File Transfer > Affects Versions: 3.2.0 > Reporter: Malte Legenhausen > Assignee: Andrew Grieve > > When I download a file under android and calculate the progress of the download the onprogress event.loaded variable is set to twice as much bytes as there where total available. > I fixed the bug for me by simply dividing the result of getTotalRawBytesRead by 2. > This bug occurs since cordova 3.0.0 only on Android. Tests on iOS return the right result. I downloaded a video file from an apache http server. -- This message was sent by Atlassian JIRA (v6.1.5#6160)