mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-15 20:06:19 +08:00
Merge branch 'master' into mq-subscribe
This commit is contained in:
@@ -213,14 +213,12 @@ func (fs *FilerServer) DeleteHandler(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
err := fs.filer.DeleteEntryMetaAndData(context.Background(), util.FullPath(objectPath), isRecursive, ignoreRecursiveError, !skipChunkDeletion, false, nil)
|
||||
if err != nil {
|
||||
glog.V(1).Infoln("deleting", objectPath, ":", err.Error())
|
||||
httpStatus := http.StatusInternalServerError
|
||||
if err == filer_pb.ErrNotFound {
|
||||
httpStatus = http.StatusNoContent
|
||||
writeJsonQuiet(w, r, httpStatus, nil)
|
||||
writeJsonQuiet(w, r, http.StatusNoContent, nil)
|
||||
return
|
||||
}
|
||||
writeJsonError(w, r, httpStatus, err)
|
||||
glog.V(1).Infoln("deleting", objectPath, ":", err.Error())
|
||||
writeJsonError(w, r, http.StatusInternalServerError, err)
|
||||
return
|
||||
}
|
||||
|
||||
|
@@ -50,7 +50,7 @@ func (fs *FilerServer) autoChunk(ctx context.Context, w http.ResponseWriter, r *
|
||||
}
|
||||
if err != nil {
|
||||
if strings.HasPrefix(err.Error(), "read input:") || err.Error() == io.ErrUnexpectedEOF.Error() {
|
||||
writeJsonError(w, r, 499, err)
|
||||
writeJsonError(w, r, util.HttpStatusCancelled, err)
|
||||
} else if strings.HasSuffix(err.Error(), "is a file") || strings.HasSuffix(err.Error(), "already exists") {
|
||||
writeJsonError(w, r, http.StatusConflict, err)
|
||||
} else {
|
||||
|
@@ -53,7 +53,7 @@ func (vs *VolumeServer) privateStoreHandler(w http.ResponseWriter, r *http.Reque
|
||||
select {
|
||||
case <-r.Context().Done():
|
||||
glog.V(4).Infof("request cancelled from %s: %v", r.RemoteAddr, r.Context().Err())
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
w.WriteHeader(util.HttpStatusCancelled)
|
||||
vs.inFlightDownloadDataLimitCond.L.Unlock()
|
||||
return
|
||||
default:
|
||||
|
Reference in New Issue
Block a user