|
@ -66,12 +66,12 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request) |
|
|
cookie := n.Cookie |
|
|
cookie := n.Cookie |
|
|
count, e := vs.store.ReadVolumeNeedle(volumeId, n) |
|
|
count, e := vs.store.ReadVolumeNeedle(volumeId, n) |
|
|
glog.V(4).Infoln("read bytes", count, "error", e) |
|
|
glog.V(4).Infoln("read bytes", count, "error", e) |
|
|
defer n.ReleaseMemory() |
|
|
|
|
|
if e != nil || count <= 0 { |
|
|
if e != nil || count <= 0 { |
|
|
glog.V(0).Infoln("read error:", e, r.URL.Path) |
|
|
glog.V(0).Infoln("read error:", e, r.URL.Path) |
|
|
w.WriteHeader(http.StatusNotFound) |
|
|
w.WriteHeader(http.StatusNotFound) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
defer n.ReleaseMemory() |
|
|
if n.Cookie != cookie { |
|
|
if n.Cookie != cookie { |
|
|
glog.V(0).Infoln("request", r.URL.Path, "with unmaching cookie seen:", cookie, "expected:", n.Cookie, "from", r.RemoteAddr, "agent", r.UserAgent()) |
|
|
glog.V(0).Infoln("request", r.URL.Path, "with unmaching cookie seen:", cookie, "expected:", n.Cookie, "from", r.RemoteAddr, "agent", r.UserAgent()) |
|
|
w.WriteHeader(http.StatusNotFound) |
|
|
w.WriteHeader(http.StatusNotFound) |
|
|