fador/mineserver — pull request #214 by debio264 (2012-09-17 00:09:25+00:00)
Title: fixed usage of libevent to prevent rare infinite loop bug

fixes #213
The underlying issue is that while we pretty much always care when a socket is readable, we only care that it's writable when we have something to write. This was previously dealt with by calling event_set over and over to make the event include or exclude the EV_WRITE condition.
It turns out that libevent doesn't support that usage of the API - event_set should only be called once per event. To correct this, I've split a user's event into separate read and write events, which can be activated and deactivated as necessary. This makes libevent work as intended.