From issues-return-51234-apmail-cordova-issues-archive=cordova.apache.org@cordova.apache.org Mon Nov 2 18:25:28 2015 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 2DE2C184F9 for ; Mon, 2 Nov 2015 18:25:28 +0000 (UTC) Received: (qmail 50095 invoked by uid 500); 2 Nov 2015 18:25:28 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 49721 invoked by uid 500); 2 Nov 2015 18:25:27 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 49613 invoked by uid 99); 2 Nov 2015 18:25:27 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2015 18:25:27 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id AFA7C2C0452 for ; Mon, 2 Nov 2015 18:25:27 +0000 (UTC) Date: Mon, 2 Nov 2015 18:25:27 +0000 (UTC) From: "Tony Leung (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CB-9936) iOS File Transfer not receiving Progress Event MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Tony Leung created CB-9936: ------------------------------ Summary: iOS File Transfer not receiving Progress Event Key: CB-9936 URL: https://issues.apache.org/jira/browse/CB-9936 Project: Apache Cordova Issue Type: Bug Components: Plugin File Transfer Affects Versions: 1.3.0 Environment: iOS Reporter: Tony Leung Priority: Minor In CDVFileTransfer.m, download() method between line 447 to 462 delegate.connection = [[NSURLConnection alloc] initWithRequest:req delegate:delegate startImmediately:NO]; if (self.queue == nil) { self.queue = [[NSOperationQueue alloc] init]; } [delegate.connection setDelegateQueue:self.queue]; @synchronized (activeTransfers) { activeTransfers[delegate.objectId] = delegate; } // Downloads can take time // sending this to a new thread calling the download_async method dispatch_async( dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, (unsigned long)NULL), ^(void) { [delegate.connection start];} ); If I replaced it with the older version of the code, then it works. delegate.connection = [NSURLConnection connectionWithRequest:req delegate:delegate]; if (activeTransfers == nil) { activeTransfers = [[NSMutableDictionary alloc] init]; } [activeTransfers setObject:delegate forKey:delegate.objectId]; In summary, if we don't use GCD to start the NSURLConnection, it works. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org