mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Merge branch 'master' into add_topo_listener
This commit is contained in:
commit
f82ac793b4
|
@ -59,10 +59,8 @@ func ParseUpload(r *http.Request) (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isChunkedFile, _ = strconv.ParseBool(r.FormValue("cm"))
|
|
||||||
|
|
||||||
if r.Method == "POST" {
|
if r.Method == "POST" {
|
||||||
fileName, data, mimeType, isGzipped, e = parseMultipart(r, isChunkedFile)
|
fileName, data, mimeType, isGzipped, isChunkedFile, e = parseMultipart(r)
|
||||||
} else {
|
} else {
|
||||||
isGzipped = false
|
isGzipped = false
|
||||||
mimeType = r.Header.Get("Content-Type")
|
mimeType = r.Header.Get("Content-Type")
|
||||||
|
|
|
@ -109,7 +109,7 @@ func reverseWalkIndexFile(r *os.File, initFn func(entryCount int64), fn func(key
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
for i := int(nextBatchSize) - 1; i >= 0; i-- {
|
for i := int(nextBatchSize) - 1; i >= 0; i-- {
|
||||||
key, offset, size := IdxFileEntry(bytes[i*NeedleEntrySize:i*NeedleEntrySize+NeedleEntrySize])
|
key, offset, size := IdxFileEntry(bytes[i*NeedleEntrySize : i*NeedleEntrySize+NeedleEntrySize])
|
||||||
if e = fn(key, offset, size); e != nil {
|
if e = fn(key, offset, size); e != nil {
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,11 +7,12 @@ import (
|
||||||
"mime"
|
"mime"
|
||||||
"net/http"
|
"net/http"
|
||||||
"path"
|
"path"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
func parseMultipart(r *http.Request, isChunkedFile bool) (
|
func parseMultipart(r *http.Request) (
|
||||||
fileName string, data []byte, mimeType string, isGzipped bool, e error) {
|
fileName string, data []byte, mimeType string, isGzipped, isChunkedFile bool, e error) {
|
||||||
form, fe := r.MultipartReader()
|
form, fe := r.MultipartReader()
|
||||||
if fe != nil {
|
if fe != nil {
|
||||||
glog.V(0).Infoln("MultipartReader [ERROR]", fe)
|
glog.V(0).Infoln("MultipartReader [ERROR]", fe)
|
||||||
|
@ -63,6 +64,8 @@ func parseMultipart(r *http.Request, isChunkedFile bool) (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isChunkedFile, _ = strconv.ParseBool(r.FormValue("cm"))
|
||||||
|
|
||||||
if !isChunkedFile {
|
if !isChunkedFile {
|
||||||
|
|
||||||
dotIndex := strings.LastIndex(fileName, ".")
|
dotIndex := strings.LastIndex(fileName, ".")
|
||||||
|
|
Loading…
Reference in a new issue