diff --git a/contrib/backends/nntpchan-daemon/libnntpchan/epoll.hpp b/contrib/backends/nntpchan-daemon/libnntpchan/epoll.hpp index cacb57c..0e4dae0 100644 --- a/contrib/backends/nntpchan-daemon/libnntpchan/epoll.hpp +++ b/contrib/backends/nntpchan-daemon/libnntpchan/epoll.hpp @@ -14,11 +14,12 @@ namespace nntpchan { namespace ev { + template struct EpollLoop : public Loop { size_t conns; int epollfd; - char readbuf[128]; + char readbuf[bufsz]; EpollLoop() : conns(0), epollfd(epoll_create1(EPOLL_CLOEXEC)) { } diff --git a/contrib/backends/nntpchan-daemon/libnntpchan/event.cpp b/contrib/backends/nntpchan-daemon/libnntpchan/event.cpp index cebdc78..ed31f9d 100644 --- a/contrib/backends/nntpchan-daemon/libnntpchan/event.cpp +++ b/contrib/backends/nntpchan-daemon/libnntpchan/event.cpp @@ -1,14 +1,17 @@ #include + +constexpr size_t ev_buffsz = 512; + #ifdef __linux__ #include "epoll.hpp" -typedef nntpchan::ev::EpollLoop LoopImpl; +typedef nntpchan::ev::EpollLoop LoopImpl; #else #ifdef __freebsd__ #include "kqueue.hpp" -typedef nntpchan::ev::KqueueLoop LoopImpl; +typedef nntpchan::ev::KqueueLoop LoopImpl; #else #ifdef __netbsd__ -typedef nntpchan::ev::KqueueLoop LoopImpl; +typedef nntpchan::ev::KqueueLoop LoopImpl; #else #error "unsupported platform" #endif diff --git a/contrib/backends/nntpchan-daemon/libnntpchan/kqueue.hpp b/contrib/backends/nntpchan-daemon/libnntpchan/kqueue.hpp index 0ef54ae..ebc2419 100644 --- a/contrib/backends/nntpchan-daemon/libnntpchan/kqueue.hpp +++ b/contrib/backends/nntpchan-daemon/libnntpchan/kqueue.hpp @@ -6,11 +6,12 @@ namespace nntpchan { namespace ev { + template struct KqueueLoop : public Loop { int kfd; size_t conns; - char readbuf[1024]; + char readbuf[bufsz]; KqueueLoop() : kfd(kqueue()), conns(0)