If we don't do this, then we never invoke the bufferevent write
callbacks until all the bufferevent's data is flushed.
--- /dev/null
+ 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.
+
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);