Skip to content

Commit

Permalink
fix: change peerPacketReady to buffer channel (#256)
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Ma <majinjing3@gmail.com>
  • Loading branch information
jim3ma authored and gaius-qi committed Jun 28, 2023
1 parent a033e5f commit 8198af0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/daemon/peer/peertask_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func newFilePeerTask(ctx context.Context,
request: request,
peerPacketStream: peerPacketStream,
pieceManager: pieceManager,
peerPacketReady: make(chan bool),
peerPacketReady: make(chan bool, 1),
peerID: request.PeerId,
taskID: result.TaskId,
singlePiece: singlePiece,
Expand Down
2 changes: 1 addition & 1 deletion client/daemon/peer/peertask_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func newStreamPeerTask(ctx context.Context,
request: request,
peerPacketStream: peerPacketStream,
pieceManager: pieceManager,
peerPacketReady: make(chan bool),
peerPacketReady: make(chan bool, 1),
peerID: request.PeerId,
taskID: result.TaskId,
singlePiece: singlePiece,
Expand Down

0 comments on commit 8198af0

Please sign in to comment.