Pseudocode for XON/XOFF decisions in Flow Control for Prop324
To simplify arti implementation and help ensure correctness and compatibility for the flow control, we need to provide pseudocode for the flow control algorithms used by Prop324.
What @dgoulet implemented for C-Tor took quite a bit of heuristics to work around kernel buffering and libevent notifications. So it might be good to provide an "ideal" algorithm, as well as pseudocode for the heuristics, as arti might be able to eliminate some of the workarounds wrt libvent.
See also: !525 (comment 2776778)