diff --git a/contrib/backends/nntpchan-daemon/libnntpchan/kqueue.hpp b/contrib/backends/nntpchan-daemon/libnntpchan/kqueue.hpp index 7edcb35..4a0f554 100644 --- a/contrib/backends/nntpchan-daemon/libnntpchan/kqueue.hpp +++ b/contrib/backends/nntpchan-daemon/libnntpchan/kqueue.hpp @@ -2,7 +2,7 @@ #include #include -#include +#include namespace nntpchan { @@ -130,7 +130,20 @@ namespace ev { int writespace = 1024; int written = handler->write(writespace); - std::cerr << "writen " << written << " of " << writespace << std::endl; + if(written == -1) + { + if (errno == EAGAIN || errno == EWOULDBLOCK) + { + // blocking + } + else + { + perror("write()"); + handler->close(); + delete handler; + continue; + } + } } if(!handler->keepalive()) {