[tor-commits] [tor/master] kist: Document a magic value in channel_should_write_to_kernel()

ahf at torproject.org ahf at torproject.org
Mon Jun 29 14:13:06 UTC 2020


commit c55e633f7446fea7b73be75f6713fad6493edf05
Author: David Goulet <dgoulet at torproject.org>
Date:   Mon Jun 22 15:28:47 2020 -0400

    kist: Document a magic value in channel_should_write_to_kernel()
    
    Closes #40008
    
    Signed-off-by: David Goulet <dgoulet at torproject.org>
---
 src/core/or/scheduler_kist.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/core/or/scheduler_kist.c b/src/core/or/scheduler_kist.c
index c73d768f8..5c1922847 100644
--- a/src/core/or/scheduler_kist.c
+++ b/src/core/or/scheduler_kist.c
@@ -445,6 +445,11 @@ update_socket_written(socket_table_t *table, channel_t *chan, size_t bytes)
  * one cell for each and bouncing back and forth. This KIST impl avoids that
  * by only writing a channel's outbuf to the kernel if it has 8 cells or more
  * in it.
+ *
+ * Note: The number 8 has been picked for no particular reasons except that it
+ * is 4096 bytes which is a common number for buffering. A TLS record can hold
+ * up to 16KiB thus using 8 cells means that a relay will at most send a TLS
+ * record of 4KiB or 1/4 of the maximum capacity of a TLS record.
  */
 MOCK_IMPL(int, channel_should_write_to_kernel,
           (outbuf_table_t *table, channel_t *chan))





More information about the tor-commits mailing list