|
@ -5,6 +5,7 @@ import ( |
|
|
"encoding/json" |
|
|
"encoding/json" |
|
|
"errors" |
|
|
"errors" |
|
|
"fmt" |
|
|
"fmt" |
|
|
|
|
|
"github.com/chrislusf/seaweedfs/weed/util/mem" |
|
|
"io" |
|
|
"io" |
|
|
"net/http" |
|
|
"net/http" |
|
|
"net/url" |
|
|
"net/url" |
|
@ -326,7 +327,8 @@ func ReadUrlAsStream(fileUrl string, cipherKey []byte, isContentGzipped bool, is |
|
|
var ( |
|
|
var ( |
|
|
m int |
|
|
m int |
|
|
) |
|
|
) |
|
|
buf := make([]byte, 64*1024) |
|
|
|
|
|
|
|
|
buf := mem.Allocate(64 * 1024) |
|
|
|
|
|
defer mem.Free(buf) |
|
|
|
|
|
|
|
|
for { |
|
|
for { |
|
|
m, err = reader.Read(buf) |
|
|
m, err = reader.Read(buf) |
|
|