You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by br...@apache.org on 2012/09/25 22:14:00 UTC

[5/8] ios commit: Add onReset to CDVFileTransfer.

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 <br...@chromium.org>
Authored: Tue Sep 25 13:38:16 2012 -0400
Committer: Braden Shepherdson <br...@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