1. ensure replicated file has the same timestamp

2. upload can specify modified time by &ts=...
3. correctly return code 304
This commit is contained in:
Chris Lu
2013-07-10 00:25:14 -07:00
parent 53b6831f73
commit 4c200acd7d
5 changed files with 20 additions and 9 deletions

View File

@@ -90,7 +90,10 @@ func NewNeedle(r *http.Request) (n *Needle, e error) {
}
n.SetHasName()
}
n.LastModified = uint64(time.Now().Unix())
var parseError error
if n.LastModified, parseError = strconv.ParseUint(r.FormValue("ts"), 10, 64); parseError != nil {
n.LastModified = uint64(time.Now().Unix())
}
n.SetHasLastModifiedDate()
n.Data = data