From 6142f7194f697bcc0b345612caa8f55fc201c380 Mon Sep 17 00:00:00 2001 From: Nakidai Date: Tue, 27 May 2025 15:09:19 +0300 Subject: Fix broadcasting When iterating through receivers code was assuming that ppeers[n].fd == peers[n] that is wrong. Noticed in #1 by @aureliumsk: https://github.com/nakidai/ttb/issues/1 --- ttb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ttb.c b/ttb.c index 8f0c561..460fd5c 100644 --- a/ttb.c +++ b/ttb.c @@ -103,7 +103,7 @@ after: } for (size_t j = 1; j < lengthof(peers); ++j) - if (peers[j] && i != j) + if (peers[j] && ppeers[i].fd != peers[j]) while (errno = 0, write(peers[j], buf, reads), errno == EINTR); } } -- cgit 1.4.1