Archived
1
0
This commit is contained in:
Jeff Becker
2018-05-03 13:38:35 -04:00
parent 4df3bc0672
commit 0c41298fe0
9 changed files with 39 additions and 43 deletions

View File

@@ -47,7 +47,7 @@ public:
private:
size_t conns;
int epollfd;
char readbuf[1024];
char readbuf[2048];
};
}

View File

@@ -2,6 +2,8 @@
#define NNTPCHAN_LINE_HPP
#include "server.hpp"
#include <stdint.h>
#include <sstream>
namespace nntpchan
{
@@ -19,11 +21,12 @@ public:
protected:
/** @brief handle a line from the client */
virtual void HandleLine(const std::string &line) = 0;
virtual void HandleLine(const std::string line) = 0;
private:
void OnLine(const char *d, const size_t l);
std::string m_leftovers;
std::stringstream m_line;
std::string m_leftover;
bool m_close;
const size_t lineLimit;
};

View File

@@ -35,7 +35,7 @@ protected:
void SetStream(std::istream *i);
std::string Hash(const std::string &data, const std::string &salt);
void HandleLine(const std::string &line);
void HandleLine(const std::string line);
private:
bool ProcessLine(const std::string &line);

View File

@@ -11,7 +11,7 @@ namespace nntpchan
class NNTPServerHandler : public LineReader, public IConnHandler
{
public:
NNTPServerHandler(const fs::path &storage);
NNTPServerHandler(fs::path storage);
~NNTPServerHandler();
virtual bool ShouldClose();
@@ -23,7 +23,7 @@ public:
void Greet();
protected:
void HandleLine(const std::string &line);
void HandleLine(const std::string line);
void HandleCommand(const std::deque<std::string> &command);
private:
@@ -51,7 +51,7 @@ private:
std::string m_articleName;
FileHandle_ptr m_article;
CredDB_ptr m_auth;
ArticleStorage_ptr m_store;
ArticleStorage m_store;
std::string m_mode;
bool m_authed;
State m_state;