Skip to content

Commit

Permalink
Merge pull request #830 from Inspirate789/master
Browse files Browse the repository at this point in the history
fix: break an infinite loop on file transfer
  • Loading branch information
smallnest authored Dec 5, 2023
2 parents 2442c5b + a069a9a commit c3e2f2e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/xclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,8 @@ loop:
for {
select {
case <-ctx.Done():
err = ctx.Err()
break loop
default:
if tb != nil {
tb.Wait(FileTransferBufferSize)
Expand Down Expand Up @@ -1257,6 +1259,8 @@ loop:
for {
select {
case <-ctx.Done():
err = ctx.Err()
break loop
default:
n, er := r.Read(buf)
if n > 0 {
Expand Down

0 comments on commit c3e2f2e

Please sign in to comment.