aboutsummaryrefslogtreecommitdiffstats
path: root/link/link.h
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-30 03:32:07 +0100
committereunhhu <[email protected]>2026-09-30 03:32:07 +0100
commitd9e0b6870201d9200b3c225903b43b850475600b (patch)
treeea4eff8cff3b84b33995e2faa3955f50a0868a89 /link/link.h
parent41cb1cca55c67dd2aac2afa2f96bdc09a5d50b78 (diff)
downloadpure-d9e0b6870201d9200b3c225903b43b850475600b.tar.gz
pure-d9e0b6870201d9200b3c225903b43b850475600b.zip
Hold a window of each output's sends in its transport, not the outbox
A link's ring and a wire's queue took every saved send of their output and kept it until delivered: with the receiver down they held the outbox a second time, 178 B and 313 B more a send (104). Each outlet now holds a window, --window bytes (4 MiB) and 65,536 sends past what its receiver has, at least one; the outbox keeps the rest. The owner remembers each outlet's place in the outbox and looks on from there after a save and after its transports deliver. Places move back by the sends that left the outbox since (PureApp.sends_gone), so a trim before a place skips nothing, and sends queued before are not looked at again however many wait. pure_app_sent reads a send by its place (the newest-first visit it replaces is gone); pure_link_held and pure_wire_held say what a transport holds. With the receiver down a node now grows by the outbox alone once the window is full: 219 and 218 B a send over the link and HTTP (399 and 534 B before). check.py server_windows keeps the receivers of a sender's two outputs, one linked and one over HTTP, down through 300 buys with a 2,000-byte window, then starts them: each applies all 300 once. Without the refill after deliveries the link stops at 117.
Diffstat (limited to 'link/link.h')
-rw-r--r--link/link.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/link/link.h b/link/link.h
index 3390a82..64846ce 100644
--- a/link/link.h
+++ b/link/link.h
@@ -22,6 +22,8 @@ bool pure_link_queue(PureLink *, uint64_t seq, const unsigned char *bytes, size_
uint64_t pure_link_queued(PureLink *);
/* The last number the receiver saved; any thread. */
uint64_t pure_link_delivered(PureLink *);
+/* The bytes of the sends queued and not yet saved; any thread. */
+size_t pure_link_held(PureLink *);
/* Packets go in bursts with UDP GSO where the system has it (at first);
* off, each in a call of its own: for a path whose queues take a burst as
* one packet (netem does). Before pure_link_start. */