diff options
| author | Nakidai <nakidai@disroot.org> | 2025-05-08 06:30:30 +0300 |
|---|---|---|
| committer | Nakidai <nakidai@disroot.org> | 2025-05-08 06:30:30 +0300 |
| commit | 8f6cf913110f57e42143e0184bfcc8e2b1fe0ec2 (patch) | |
| tree | 066e0d03d6f1e2527cfb0ace49c857678f12266e | |
| parent | 536728b5c742e63d7437a7cbc7f57592fea59e40 (diff) | |
| download | ttb-8f6cf913110f57e42143e0184bfcc8e2b1fe0ec2.tar.gz ttb-8f6cf913110f57e42143e0184bfcc8e2b1fe0ec2.zip | |
Fix bug in write
On each iteration of partial write ttb need to shift data it want to send rather than try to resend whole buffer again
| -rw-r--r-- | ttb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ttb.c b/ttb.c index 4fb90d8..24c7a42 100644 --- a/ttb.c +++ b/ttb.c @@ -108,7 +108,7 @@ after: size_t writtenall = 0; while (writtenall < reads) { - ssize_t written = write(peers[j], buf, reads); + ssize_t written = write(peers[j], buf + writtenall, reads - writtenall); if (written == -1) break; else |