eloop: dynamically reallocate dispatch cache
We do not maintain event caches so we must make sure that every event
source gets dispatched. If we call epoll_wait() and our buffer gets
filled everytime, then there might be an event source that does not get
dispatched because it is always above the buffer range. Therefore, we now
dynamically increase the cache size when it once gets filled up.
This gets critical if we handle thousands of clients or fds, however, our
use case is limited to some system resources and hence does not suffer
here.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>