Added server move detection when hashes match or downloading
[pithos-ms-client] / trunk / Pithos.Network / CloudFilesClient.cs
index 1e83328..a1e0b99 100644 (file)
@@ -789,6 +789,7 @@ namespace Pithos.Network
                                                    Container = container,
                                                    Name = objectName,
                                                    ETag = client.GetHeaderValue("ETag"),
+                                                   UUID=client.GetHeaderValue("X-Object-UUID"),
                                                    X_Object_Hash = client.GetHeaderValue("X-Object-Hash"),
                                                    Content_Type = client.GetHeaderValue("Content-Type"),
                                                    Bytes = Convert.ToInt64(client.GetHeaderValue("Content-Length",true)),
@@ -1031,6 +1032,8 @@ namespace Pithos.Network
             //Send the tree hash as Json to the server            
             client.Headers[HttpRequestHeader.ContentType] = "application/octet-stream";
             var jsonHash = hash.ToJson();
+                        
+            client.Headers.Add("ETag",hash.MD5);
             var uploadTask=client.UploadStringTask(uri, "PUT", jsonHash);
             if (Log.IsDebugEnabled)
                 Log.DebugFormat("Hashes:\r\n{0}", jsonHash);