mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
d3288293fd
The different bufferevent implementations had different behavior for their timeouts. Some of them kept re-triggering the timeouts indefinitely; some disabled the event immediately the first time a timeout triggered. Some of them made the timeouts only count when the bufferevent was actively trying to read or write; some did not. The new behavior is modeled after old socket bufferevents, since they were here first and their behavior is relatively sane. Basically, each timeout disables the bufferevent's corresponding read or write operation when it fires. Timeouts are stopped whenever we suspend writing or reading, and reset whenever we unsuspend writing or reading. Calling bufferevent_enable resets a timeout, as does changing the timeout value.