[simias-svn] SF.net SVN: simias:[7319] trunk/src/core/Sync/SyncPolicy.cs
Brought to you by:
srinidhi_bs
|
From: <he...@us...> - 2010-02-28 05:29:02
|
Revision: 7319
http://simias.svn.sourceforge.net/simias/?rev=7319&view=rev
Author: hegdegg
Date: 2010-02-28 05:28:55 +0000 (Sun, 28 Feb 2010)
Log Message:
-----------
While calculating the diskquota, if the file is already existsing,
subtract the exisintg file size and then add the new file size for
checking diskquota.
Modified Paths:
--------------
trunk/src/core/Sync/SyncPolicy.cs
Modified: trunk/src/core/Sync/SyncPolicy.cs
===================================================================
--- trunk/src/core/Sync/SyncPolicy.cs 2010-02-28 05:21:46 UTC (rev 7318)
+++ trunk/src/core/Sync/SyncPolicy.cs 2010-02-28 05:28:55 UTC (rev 7319)
@@ -92,6 +92,19 @@
public bool Allowed(BaseFileNode fNode)
{
long fSize = fNode.Length;
+ /* If the file is already present on the server, upload size would be
+ * size of file on the server subtracted by size of file to upload */
+ Store stl =Store.GetStore();
+ Domain dom =stl.GetDomain(stl.DefaultDomain);
+ Node n1 = dom.GetNodeByID(fNode.ID);
+ if(n1 != null)
+ {
+ FileNode f1 = n1 as FileNode;
+ if(f1.Length <= fSize)
+ fSize = fSize - f1.Length;
+ else
+ fSize = 0;
+ }
if(!GroupDiskQuotaUploadAllowed(fSize))
{
reason = PolicyType.Quota;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|