-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #858, 更改默认的下载模式 fix #872, 优化上传的重试判断 fix #845, 修复md5显示不正确 fix #513, 已增加上传限速
- Loading branch information
Showing
11 changed files
with
67 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ name="BaiduPCS-Go" | |
version=$1 | ||
|
||
if [ "$1" = "" ]; then | ||
version=v3.6.1 | ||
version=v3.6.2 | ||
fi | ||
|
||
output="out/" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package uploader_test | ||
|
||
import ( | ||
"fmt" | ||
"github.com/iikira/BaiduPCS-Go/pcsutil/cachepool" | ||
"github.com/iikira/BaiduPCS-Go/requester/rio" | ||
"github.com/iikira/BaiduPCS-Go/requester/transfer" | ||
"github.com/iikira/BaiduPCS-Go/requester/uploader" | ||
"io" | ||
"testing" | ||
) | ||
|
||
var ( | ||
blockList = uploader.SplitBlock(10000, 999) | ||
) | ||
|
||
func TestSplitBlock(t *testing.T) { | ||
for k, e := range blockList { | ||
fmt.Printf("%d %#v\n", k, e) | ||
} | ||
} | ||
|
||
func TestSplitUnitRead(t *testing.T) { | ||
var size int64 = 65536*2+3432 | ||
buffer := rio.NewBuffer(cachepool.RawMallocByteSlice(int(size))) | ||
unit := uploader.NewBufioSplitUnit(buffer, transfer.Range{Begin: 2, End: size}, nil, nil) | ||
|
||
buf := cachepool.RawMallocByteSlice(1022) | ||
for { | ||
n, err := unit.Read(buf) | ||
if err != nil { | ||
if err == io.EOF { | ||
break | ||
} | ||
t.Fatalf("read error: %s\n", err) | ||
} | ||
fmt.Printf("n: %d, left: %d\n", n, unit.Left()) | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters