You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2015/05/12 02:52:36 UTC

[3/3] cordova-plugin-file-transfer git commit: fix failing test resulting from overlapping async calls

fix failing test resulting from overlapping async calls


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/commit/f1e41ac1
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/tree/f1e41ac1
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/diff/f1e41ac1

Branch: refs/heads/master
Commit: f1e41ac1f55b94e539b8e9346dfe1e6ffabb8aee
Parents: 65eea29
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Mon May 11 17:47:08 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Mon May 11 17:47:08 2015 -0700

----------------------------------------------------------------------
 src/wp/FileTransfer.cs | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/blob/f1e41ac1/src/wp/FileTransfer.cs
----------------------------------------------------------------------
diff --git a/src/wp/FileTransfer.cs b/src/wp/FileTransfer.cs
index e9b3182..c74738e 100644
--- a/src/wp/FileTransfer.cs
+++ b/src/wp/FileTransfer.cs
@@ -377,6 +377,11 @@ namespace WPCordovaClassLib.Cordova.Commands
                 webRequest.ContentType = "multipart/form-data; boundary=" + Boundary;
                 webRequest.Method = uploadOptions.Method;
 
+                DownloadRequestState reqState = new DownloadRequestState();
+                InProcDownloads[uploadOptions.Id] = reqState;
+                reqState.options = uploadOptions;
+                reqState.request = webRequest;
+
                 // Associate cookies with the request
                 // This is an async call, so we need to await it in order to preserve proper control flow
                 await CopyCookiesFromWebBrowser(webRequest);
@@ -393,12 +398,6 @@ namespace WPCordovaClassLib.Cordova.Commands
                     }
                 }
 
-                DownloadRequestState reqState = new DownloadRequestState();
-                reqState.options = uploadOptions;
-                reqState.request = webRequest;
-
-                InProcDownloads[uploadOptions.Id] = reqState;
-
                 webRequest.BeginGetRequestStream(uploadCallback, reqState);
             }
             catch (Exception /*ex*/)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org