Update object size earlier, since parsing/etc. depends on it being right.

This commit is contained in:
alexhudson
2010-07-19 14:24:29 +00:00
parent 85d60788b8
commit f362ada8bb
+1 -1
View File
@@ -2830,6 +2830,7 @@ StoreCommandREPLACE(StoreClient *client, StoreObject *object, int size, uint64_t
// writing a range - new size must be maximum of old size and new end of range
tmpsize = rend;
}
object->size = tmpsize;
// we gain the lock quite late - we have the new file, but haven't updated
// anything yet. Potential waste of effort.
@@ -2861,7 +2862,6 @@ StoreCommandREPLACE(StoreClient *client, StoreObject *object, int size, uint64_t
}
// update other metadata
StoreObjectUpdateModifiedTime(object);
object->size = tmpsize;
if (StoreObjectSave(client, object)) {
ccode = ConnWriteStr(client->conn, MSG5005DBLIBERR);