diff options
| author | tnextday <fw2k4@163.com> | 2015-12-03 21:35:33 +0800 |
|---|---|---|
| committer | tnextday <fw2k4@163.com> | 2015-12-03 21:35:33 +0800 |
| commit | 82e6d67ccca361a4841b9e40548c9d0d23981423 (patch) | |
| tree | ad9383cf18bf89be9c8954e8eb9e59eede592e97 /go/operation/chunked_file.go | |
| parent | 4fda5f8bfdd8973cc08e5f90c32e3389395ff066 (diff) | |
| download | seaweedfs-82e6d67ccca361a4841b9e40548c9d0d23981423.tar.xz seaweedfs-82e6d67ccca361a4841b9e40548c9d0d23981423.zip | |
update
Diffstat (limited to 'go/operation/chunked_file.go')
| -rw-r--r-- | go/operation/chunked_file.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/go/operation/chunked_file.go b/go/operation/chunked_file.go index dbc450fd8..f8266087b 100644 --- a/go/operation/chunked_file.go +++ b/go/operation/chunked_file.go @@ -87,7 +87,7 @@ func (cm *ChunkManifest) DeleteChunks(master string) error { // return nil //} -func httpRangeDownload(fileUrl string, w io.Writer, offset int64) (written int64, e error) { +func readChunkNeedle(fileUrl string, w io.Writer, offset int64) (written int64, e error) { req, err := http.NewRequest("GET", fileUrl, nil) if err != nil { return written, err @@ -112,7 +112,7 @@ func httpRangeDownload(fileUrl string, w io.Writer, offset int64) (written int64 case http.StatusPartialContent: break default: - return written, fmt.Errorf("Read Needle http error: [%d] %s", resp.StatusCode, fileUrl) + return written, fmt.Errorf("Read chunk needle error: [%d] %s", resp.StatusCode, fileUrl) } return io.Copy(w, resp.Body) @@ -158,7 +158,7 @@ func (cf *ChunkedFileReader) WriteTo(w io.Writer) (n int64, err error) { if lookupError != nil { return n, lookupError } - if wn, e := httpRangeDownload(fileUrl, w, chunkStartOffset); e != nil { + if wn, e := readChunkNeedle(fileUrl, w, chunkStartOffset); e != nil { return n, e } else { n += wn |
