]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
sendme: Do not decrement window in a log_debug()
authorDavid Goulet <dgoulet@torproject.org>
Mon, 3 Jun 2019 18:31:51 +0000 (14:31 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Mon, 3 Jun 2019 18:31:51 +0000 (14:31 -0400)
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@torproject.org>
changes/ticket30628 [new file with mode: 0644]
src/core/or/sendme.c

diff --git a/changes/ticket30628 b/changes/ticket30628
new file mode 100644 (file)
index 0000000..7128c5a
--- /dev/null
@@ -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.
index 7d409a16ad4bbd59bcf36007b6b37ce5b5d6a7fc..47ac95f3cff61bf203d24d4027e30f982ac88ed9 100644 (file)
@@ -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;
 }