incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bra...@apache.org
Subject [5/8] ios commit: Add onReset to CDVFileTransfer.
Date Tue, 25 Sep 2012 20:14:00 GMT
Add onReset to CDVFileTransfer.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/bdcf8e47
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/bdcf8e47
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/bdcf8e47

Branch: refs/heads/master
Commit: bdcf8e47f990189d041a9a8166e3f80678798bed
Parents: e9706dc
Author: Braden Shepherdson <braden@chromium.org>
Authored: Tue Sep 25 13:38:16 2012 -0400
Committer: Braden Shepherdson <braden@chromium.org>
Committed: Tue Sep 25 13:38:16 2012 -0400

----------------------------------------------------------------------
 CordovaLib/Classes/CDVFileTransfer.m |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/bdcf8e47/CordovaLib/Classes/CDVFileTransfer.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVFileTransfer.m b/CordovaLib/Classes/CDVFileTransfer.m
index eaaa3ca..652546b 100644
--- a/CordovaLib/Classes/CDVFileTransfer.m
+++ b/CordovaLib/Classes/CDVFileTransfer.m
@@ -393,6 +393,16 @@ static CFIndex WriteDataToStream(NSData* data, CFWriteStreamRef stream)
     return result;
 }
 
+- (void)onReset
+{
+    for (CDVFileTransferDelegate* delegate in [activeTransfers allValues]) {
+        if (delegate != nil) {
+            [delegate.connection cancel];
+        }
+    }
+    [activeTransfers removeAllObjects];
+}
+
 @end
 
 @implementation CDVFileTransferDelegate


Mime
View raw message