Revision 692ec33b trunk/Pithos.Network/CloudFilesClient.cs
b/trunk/Pithos.Network/CloudFilesClient.cs | ||
---|---|---|
7 | 7 |
using System.Collections.Generic; |
8 | 8 |
using System.Collections.Specialized; |
9 | 9 |
using System.ComponentModel.Composition; |
10 |
using System.Diagnostics; |
|
10 | 11 |
using System.Diagnostics.Contracts; |
11 | 12 |
using System.IO; |
12 | 13 |
using System.Linq; |
... | ... | |
946 | 947 |
|
947 | 948 |
|
948 | 949 |
//Don't use a timeout because putting the hashmap may be a long process |
949 |
var client = new RestClient(_baseClient) { Timeout = 0 }; |
|
950 |
var client = new RestClient(_baseClient) { Timeout = 0 };
|
|
950 | 951 |
if (!String.IsNullOrWhiteSpace(account)) |
951 | 952 |
client.BaseAddress = GetAccountUrl(account); |
952 | 953 |
|
... | ... | |
959 | 960 |
|
960 | 961 |
//Send the tree hash as Json to the server |
961 | 962 |
client.Headers[HttpRequestHeader.ContentType] = "application/octet-stream"; |
962 |
var uploadTask=client.UploadStringTask(uri, "PUT", hash.ToJson());
|
|
963 |
|
|
963 |
var jsonHash = hash.ToJson();
|
|
964 |
var uploadTask=client.UploadStringTask(uri, "PUT", jsonHash); |
|
964 | 965 |
|
965 | 966 |
return uploadTask.ContinueWith(t => |
966 | 967 |
{ |
... | ... | |
987 | 988 |
using (var stream = response.GetResponseStream()) |
988 | 989 |
using(var reader=new StreamReader(stream)) |
989 | 990 |
{ |
991 |
Debug.Assert(stream.Position == 0); |
|
990 | 992 |
//We need to cleanup the content before returning it because it contains |
991 | 993 |
//error content after the list of hashes |
992 | 994 |
var hashes = new List<string>(); |
Also available in: Unified diff