]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Set write low-watermarks on all bufferevents.
authorNick Mathewson <nickm@torproject.org>
Wed, 24 Aug 2011 21:30:20 +0000 (17:30 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 24 Aug 2011 21:31:37 +0000 (17:31 -0400)
If we don't do this, then we never invoke the bufferevent write
callbacks until all the bufferevent's data is flushed.

changes/bug3805 [new file with mode: 0644]
src/or/connection.c

diff --git a/changes/bug3805 b/changes/bug3805
new file mode 100644 (file)
index 0000000..9d12b81
--- /dev/null
@@ -0,0 +1,5 @@
+  o Major bugfixes (bufferevents):
+    - Correctly notice when data has been written from a bufferevent
+      without flushing it completely. Bugfix on 0.2.3.1-alpha; fixes
+      bug 3805.
+
index c4cbef4c9dcf1b45461c08d3f551adba0b416302..dc804ddcecdf3e182f3461be9f9298a1e01044b7 100644 (file)
@@ -2947,6 +2947,11 @@ connection_configure_bufferevent_callbacks(connection_t *conn)
                     connection_handle_write_cb,
                     connection_handle_event_cb,
                     conn);
+  /* Set a fairly high write low-watermark so that we get the write callback
+     called whenever data is written to bring us under 128K.  Leave the
+     high-watermark at 0.
+  */
+  bufferevent_setwatermark(bufev, EV_WRITE, 128*1024, 0);
 
   input = bufferevent_get_input(bufev);
   output = bufferevent_get_output(bufev);