From: Panagiotis Kanavos Date: Sun, 18 Sep 2011 17:21:21 +0000 (+0300) Subject: Removed differences between Pithos and Cloudfiles authentication. X-Git-Url: https://code.grnet.gr/git/pithos-ms-client/commitdiff_plain/cd7c162f79017a08f679661ea82a3da0bbfc3cad Removed differences between Pithos and Cloudfiles authentication. Pithos returns the ApiKey and actual URL as Token and Storage Url respectively. Thus it can respond to the auth requests of cloudfiles clients --- diff --git a/trunk/Pithos.Client.WPF/App.xaml.cs b/trunk/Pithos.Client.WPF/App.xaml.cs index d3bf5db..cfc45b6 100644 --- a/trunk/Pithos.Client.WPF/App.xaml.cs +++ b/trunk/Pithos.Client.WPF/App.xaml.cs @@ -19,7 +19,7 @@ namespace Pithos.Client.WPF public App() { var extensionController = new ShellExtensionController(); - extensionController.RegisterExtensions(); + //extensionController.RegisterExtensions(); var appPatth = Assembly.GetExecutingAssembly().Location; diff --git a/trunk/Pithos.Core/JobQueue.cs b/trunk/Pithos.Core/JobQueue.cs index 78aa206..9fae16b 100644 --- a/trunk/Pithos.Core/JobQueue.cs +++ b/trunk/Pithos.Core/JobQueue.cs @@ -32,6 +32,9 @@ namespace Pithos.Core private void ProcessUpdates() { + Parallel.ForEach(_statusUpdateQueue.GetConsumingEnumerable(), + new ParallelOptions{MaxDegreeOfParallelism=1,CancellationToken=_cancellationToken}, + action => action()); foreach (var action in _statusUpdateQueue.GetConsumingEnumerable()) { action(); diff --git a/trunk/Pithos.Network/CloudFilesClient.cs b/trunk/Pithos.Network/CloudFilesClient.cs index ad1eb77..a32f223 100644 --- a/trunk/Pithos.Network/CloudFilesClient.cs +++ b/trunk/Pithos.Network/CloudFilesClient.cs @@ -58,32 +58,25 @@ namespace Pithos.Network UserName = userName; ApiKey = apiKey; - if (UsePithos) - { - Token = ApiKey; - string storageUrl = String.Format("{0}/{1}/{2}", AuthenticationUrl, VersionPath, UserName); - StorageUrl = new Uri(storageUrl); - } - else - { - string authUrl = String.Format("{0}/{1}", AuthenticationUrl, VersionPath); - var authClient = new PithosClient{BaseAddress= authUrl}; + using (var authClient = new PithosClient{BaseAddress=AuthenticationUrl}) + { if (Proxy != null) authClient.Proxy = new WebProxy(Proxy); authClient.Headers.Add("X-Auth-User", UserName); authClient.Headers.Add("X-Auth-Key", ApiKey); - var response = authClient.DownloadStringWithRetry("",3); + authClient.DownloadStringWithRetry(VersionPath, 3); authClient.AssertStatusOK("Authentication failed"); - string storageUrl = authClient.GetHeaderValue("X-Storage-Url"); + var storageUrl = authClient.GetHeaderValue("X-Storage-Url"); if (String.IsNullOrWhiteSpace(storageUrl)) throw new InvalidOperationException("Failed to obtain storage url"); StorageUrl = new Uri(storageUrl); - + UriBuilder b; + b.Scheme; var token = authClient.GetHeaderValue("X-Auth-Token"); if (String.IsNullOrWhiteSpace(token)) throw new InvalidOperationException("Failed to obtain token url"); diff --git a/trunk/Pithos.sln b/trunk/Pithos.sln index 20d762c..a965b2d 100644 --- a/trunk/Pithos.sln +++ b/trunk/Pithos.sln @@ -48,7 +48,6 @@ Global EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {240B432F-1030-4623-BCC3-FF351D6C1B63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {240B432F-1030-4623-BCC3-FF351D6C1B63}.Debug|Any CPU.Build.0 = Debug|Any CPU {240B432F-1030-4623-BCC3-FF351D6C1B63}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {240B432F-1030-4623-BCC3-FF351D6C1B63}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {240B432F-1030-4623-BCC3-FF351D6C1B63}.Debug|x86.ActiveCfg = Debug|Any CPU