New patch included. On Sat, Sep 22, 2018 at 07:09:44AM +0100, Jason McIntyre wrote: > does the "ok" request mean you have commit access? (sorry, find it hard > to keep track)
Nope, no commit access, just a user sending up a documentation fix. > regarding the markup: there is no need to quote your argument. actually > it would be inconsistent to do so. if the intent was to actually display > quotes in the formatted page (which would be wrong too), you would have > to use a macro such as Dq. Fixed these. Changed to end up leaving the previous paragraph as-is. > you need a space between the arg and punctuation Fixed. > you can find trivial errors like that if you run your changes through > mandoc: > > $ mandoc -Tlint event.3 Thanks, that is good to know. Should have kept mdoc(7) up while writing. Geoff Index: event.3 =================================================================== RCS file: /cvs/src/lib/libevent/event.3,v retrieving revision 1.54 diff -u -p -u -r1.54 event.3 --- event.3 26 Jul 2018 12:50:04 -0000 1.54 +++ event.3 22 Sep 2018 17:16:18 -0000 @@ -68,6 +68,7 @@ .Nm bufferevent_enable , .Nm bufferevent_disable , .Nm bufferevent_settimeout , +.Nm bufferevent_setwatermark , .Nm EVBUFFER_INPUT , .Nm EVBUFFER_OUTPUT .Nd execute a function when a specific event occurs @@ -156,6 +157,8 @@ .Fn "bufferevent_disable" "struct bufferevent *bufev" "short event" .Ft void .Fn "bufferevent_settimeout" "struct bufferevent *bufev" "int timeout_read" "int timeout_write" +.Ft void +.Fn "bufferevent_setwatermark" "struct bufferevent *bufev" "short events" "size_t lowmark" "size_t highmark" .Ft "struct evbuffer *" .Fn "EVBUFFER_INPUT" "struct bufferevent *bufev" .Ft "struct evbuffer *" @@ -496,6 +499,30 @@ whenever the output buffer is drained be which is .Va 0 by default. +.Pp +The +.Fn bufferevent_setwatermark +function can set the low and high watermarks +for read and write events. +.Fa "events" +can be +.Va EV_READ , +.Va EV_WRITE +or both via bitwise-OR. +When used with +.Va EV_READ , +a bufferevent does not invoke the user read callback +unless there is at least +.Fa lowmark +data in the buffer. +If the read buffer is beyond +.Fa highmark , +the bufferevent stops reading from the file descriptor. +When used with +.Va EV_WRITE , +the user write callback is invoked whenever the buffered data +falls below +.Fa lowmark . .Pp The .Fn bufferevent_write
