See Etienne Samson's patches for this... but even if they don't go through as-is, *something* should. Right now you can't use bufferevents for UDP sockets, and that's a problem.
The steps in UDP bufferevent support are, more or less:
* Get evbuffers to support a flag or mode of operation where chunks are never resized or realigned.
* Get evbuffer chunks to support containing an extra sockaddr somehow for when we're running with unconnected sockets. Obviously, we don't want to do this in a way that will bloat other evbuffers. We will also need a way to do a packet-at-a-time drain and append for these modes.
* Get evbuffers to support read and write modes other than "write to a stream socket as efficiently as possible." In particular, we need to support one-chunk-at-a-time send/recv, and one-chunk-at-a-time sendfrom/recvfrom.
* Figure out how to do space-minimization on chunks. There's no need to allocate a 64k buffer ever time we do a recvfrom. Can we do a low-copy implementation?
* Examine what needs to change in the bufferevent interfaces to support these modes of operation. SSL is nonsensical here; bufferevent_socket and bufferevent_filter *might* work as-is, but they probably need some notion of chunk-at-a-time operation so that they don't try to operate on partial packets.
* Test, test, test.