Archived
1
0

freebsd support

This commit is contained in:
Jeff Becker 2018-05-06 11:15:01 -04:00
parent 852a847c58
commit 1077f0935e
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

View File

@ -2,7 +2,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/event.h> #include <sys/event.h>
#include <iostream> #include <cstring>
namespace nntpchan namespace nntpchan
{ {
@ -130,7 +130,20 @@ namespace ev
{ {
int writespace = 1024; int writespace = 1024;
int written = handler->write(writespace); 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()) if(!handler->keepalive())
{ {