fix(stream): http chucked upload issue (#1152)

* fix(stream): http chucked upload issue

* fix(stream): use MmapThreshold

* fix(stream): improve caching mechanism and handle size=0 case

* fix bug

* fix(buffer): optimize ReadAt method for improved performance

* fix(upload): handle Content-Length and File-Size headers for better size management

* fix(189pc): 移除重复限速

* fix(upload): handle negative file size during streaming uploads

* fix(upload): update header key from File-Size to X-File-Size for size retrieval

---------

Co-authored-by: j2rong4cn <j2rong@qq.com>
This commit is contained in:
TwoOnefour
2025-09-15 19:36:16 +08:00
committed by GitHub
parent c1d03c5bcc
commit cbbb5ad231
8 changed files with 207 additions and 45 deletions

View File

@ -13,8 +13,7 @@ func TestReader_ReadAt(t *testing.T) {
}
bs := &Reader{}
bs.Append([]byte("github.com"))
bs.Append([]byte("/"))
bs.Append([]byte("OpenList"))
bs.Append([]byte("/OpenList"))
bs.Append([]byte("Team/"))
bs.Append([]byte("OpenList"))
tests := []struct {
@ -71,7 +70,7 @@ func TestReader_ReadAt(t *testing.T) {
off: 24,
},
want: func(a args, n int, err error) error {
if n != bs.Len()-int(a.off) {
if n != int(bs.Size()-a.off) {
return errors.New("read length not match")
}
if string(a.p[:n]) != "OpenList" {