Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1290 from antsystem/feat/add-seed-response
Browse files Browse the repository at this point in the history
add seed response in seed pattern.
  • Loading branch information
lowzj authored Apr 17, 2020
2 parents 9426ea9 + 0996a1b commit 0e4e541
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions dfget/types/register_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,10 @@ type RegisterResponseData struct {
FileLength int64 `json:"fileLength"`
PieceSize int32 `json:"pieceSize"`
CDNSource apiTypes.CdnSource `json:"cdnSource"`

// in seed pattern, if peer selected as seed, AsSeed sets true.
AsSeed bool `json:"asSeed"`

// in seed pattern, if as seed, SeedTaskID is the taskID of seed file.
SeedTaskID string `json:"seedTaskID"`
}
4 changes: 0 additions & 4 deletions dfget/types/report_piece_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,4 @@ type ReportPieceRequest struct {
Cid string `request:"cid"`
DstCid string `request:"dstCid"`
PieceRange string `request:"pieceRange"`
// seed resp
AsSeed bool `json:"asSeed"`
// if as seed, SeedTaskID is the taskID of seed file.
SeedTaskID string `json:"seedTaskID"`
}
6 changes: 6 additions & 0 deletions supernode/server/0.3_bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ type RegisterResponseData struct {
FileLength int64 `json:"fileLength"`
PieceSize int32 `json:"pieceSize"`
CDNSource string `json:"cdnSource"`

// in seed pattern, if peer selected as seed, AsSeed sets true.
AsSeed bool `json:"asSeed"`

// in seed pattern, if as seed, SeedTaskID is the taskID of seed file.
SeedTaskID string `json:"seedTaskID"`
}

// PullPieceTaskResponseContinueData is the data when successfully pulling piece task
Expand Down

0 comments on commit 0e4e541

Please sign in to comment.