Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
be_filter: avoid data stuck under active watermarks
Suppose we have bufferevent filter attached to bufferevent socket. Read high watermark for bufferevent filter is configured to 4096 bytes. Socket receives 4343 bytes. Due to watermark, 4096 bytes are transferred from socket input buffer to filter input buffer and 247 bytes are left in bufferevent socket. Suppose that no more data is received through socket. At this point 247 bytes will sit forever in input buffer of bufferevent socket. The patch attached solves this issue registering read callback to filter's input buffer if it reaches its read high water mark and data was left in corresponding underlying's input buffer. This read callback calls filter process input function as soon as filter input buffer falls below its read high watermark and there still is data left in underlying input buffer. Callback is deregistered as soon as filter input buffer falls below its read high watermark.
- Loading branch information
Showing
1 changed file
with
73 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters