server: fix some typo and support auto set cache size

This commit is contained in:
Nick Peng
2023-03-21 21:06:32 +08:00
parent bf68385d0e
commit 4f2867b7f4
14 changed files with 121 additions and 42 deletions

View File

@@ -36,7 +36,12 @@ class Server
CONF_TYPE_STRING,
CONF_TYPE_FILE,
};
enum CREATE_MODE {
CREATE_MODE_FORK,
CREATE_MODE_THREAD,
};
Server();
Server(enum CREATE_MODE mode);
virtual ~Server();
bool Start(const std::string &conf, enum CONF_TYPE type = CONF_TYPE_STRING);
@@ -45,9 +50,11 @@ class Server
private:
pid_t pid_;
std::thread thread_;
int fd_;
std::string conf_file_;
bool clean_conf_file_{false};
enum CREATE_MODE mode_;
};
struct ServerRequestContext {