Archived
1
0

dynamic translations

This commit is contained in:
Jeff Becker
2017-10-10 12:17:38 -04:00
parent 579bf619f4
commit e25b84c686
16 changed files with 235 additions and 109 deletions

View File

@@ -113,7 +113,7 @@ namespace nntpchan
QueueLine("STREAMING");
QueueLine(".");
} else if (cmd == "CHECK") {
if(cmdlen == 2) {
if(cmdlen >= 2) {
const std::string & msgid = command[1];
if(IsValidMessageID(msgid) && m_store.Accept(msgid))
{

View File

@@ -90,15 +90,16 @@ namespace nntpchan
}, [] (uv_stream_t * s, ssize_t nread, const uv_buf_t * b) {
IServerConn * self = (IServerConn*) s->data;
if(self == nullptr) {
delete [] b->base;
if(b->base)
delete [] b->base;
return;
}
if(nread > 0) {
b->base[nread] = 0;
self->m_handler->OnData(b->base, nread);
self->SendNextReply();
if(self->m_handler->ShouldClose())
self->Close();
delete [] b->base;
} else {
if (nread != UV_EOF) {
std::cerr << "error in nntp server conn alloc: ";
@@ -108,7 +109,6 @@ namespace nntpchan
// got eof or error
self->Close();
}
delete [] b->base;
});
}