Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Commit 0e4e541

Browse files
authored
Merge pull request #1290 from antsystem/feat/add-seed-response
add seed response in seed pattern.
2 parents 9426ea9 + 0996a1b commit 0e4e541

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

dfget/types/register_response.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,10 @@ type RegisterResponseData struct {
4141
FileLength int64 `json:"fileLength"`
4242
PieceSize int32 `json:"pieceSize"`
4343
CDNSource apiTypes.CdnSource `json:"cdnSource"`
44+
45+
// in seed pattern, if peer selected as seed, AsSeed sets true.
46+
AsSeed bool `json:"asSeed"`
47+
48+
// in seed pattern, if as seed, SeedTaskID is the taskID of seed file.
49+
SeedTaskID string `json:"seedTaskID"`
4450
}

dfget/types/report_piece_request.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,4 @@ type ReportPieceRequest struct {
2323
Cid string `request:"cid"`
2424
DstCid string `request:"dstCid"`
2525
PieceRange string `request:"pieceRange"`
26-
// seed resp
27-
AsSeed bool `json:"asSeed"`
28-
// if as seed, SeedTaskID is the taskID of seed file.
29-
SeedTaskID string `json:"seedTaskID"`
3026
}

supernode/server/0.3_bridge.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ type RegisterResponseData struct {
4040
FileLength int64 `json:"fileLength"`
4141
PieceSize int32 `json:"pieceSize"`
4242
CDNSource string `json:"cdnSource"`
43+
44+
// in seed pattern, if peer selected as seed, AsSeed sets true.
45+
AsSeed bool `json:"asSeed"`
46+
47+
// in seed pattern, if as seed, SeedTaskID is the taskID of seed file.
48+
SeedTaskID string `json:"seedTaskID"`
4349
}
4450

4551
// PullPieceTaskResponseContinueData is the data when successfully pulling piece task

0 commit comments

Comments
 (0)