[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] sendme: Do not decrement window in a log_debug()



commit 33382184b67d43b859de2f50d24cc7955b9f0db7
Author: David Goulet <dgoulet@xxxxxxxxxxxxxx>
Date:   Mon Jun 3 14:31:51 2019 -0400

    sendme: Do not decrement window in a log_debug()
    
    If "Log debug ..." is not set, the decrement never happens. This lead to the
    package/deliver window to be out of sync at the stream level and thus breaking
    the connection after 50+ cells.
    
    Fixes #30628
    
    Signed-off-by: David Goulet <dgoulet@xxxxxxxxxxxxxx>
---
 changes/ticket30628  | 5 +++++
 src/core/or/sendme.c | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/changes/ticket30628 b/changes/ticket30628
new file mode 100644
index 000000000..7128c5acf
--- /dev/null
+++ b/changes/ticket30628
@@ -0,0 +1,5 @@
+  o Major bugfixes (Flow Control, SENDME):
+    - The decrement of the stream-level package window was done in a log_debug()
+      statement meaning that if the debug logs were not enabled, the decrement
+      would never happen and thus the window would be out of sync with the other
+      end point. Fixes bug 30628; bugfix on 0.4.1.1-alpha.
diff --git a/src/core/or/sendme.c b/src/core/or/sendme.c
index 7d409a16a..47ac95f3c 100644
--- a/src/core/or/sendme.c
+++ b/src/core/or/sendme.c
@@ -619,7 +619,9 @@ int
 sendme_note_stream_data_packaged(edge_connection_t *conn)
 {
   tor_assert(conn);
-  log_debug(LD_APP, "Stream package_window now %d.", --conn->package_window);
+
+  --conn->package_window;
+  log_debug(LD_APP, "Stream package_window now %d.", conn->package_window);
   return conn->package_window;
 }
 

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits