Heavily overhauled client command handling and changed motd to use multi-line text.
This commit is contained in:
1 parent
28efbfb185
commit
f37999498c
3 files changed
+207
-187
No files matched your search
+14
-4
@@ -248,7 +248,9 @@ int main(int argc , char *argv[]) {
|
||||
logger->openFileOnLevel(LOGLEVEL_ERROR, config->getValue("logging", "error", mainLogFile).c_str());
|
||||
logger->openFileOnLevel(LOGLEVEL_CRITICAL, config->getValue("logging", "critical", mainLogFile).c_str());
|
||||
|
||||
if (config->getBool("net", "ssl", false)) {
|
||||
bool ssl_enable = config->getBool("net", "ssl", true);
|
||||
bool ssl_flags = SSL_OP_NO_TICKET;
|
||||
if (ssl_enable) {
|
||||
std::string cert_file = config->getValue("ssl", "certificate", "cert.pem");
|
||||
if (cert_file[0] != '/')
|
||||
cert_file = concatPath(std::string(CONFIG_DIR), cert_file);
|
||||
@@ -264,7 +266,6 @@ int main(int argc , char *argv[]) {
|
||||
// set configured ciphers
|
||||
SSLManager::getInstance().setCiphers(config->getValue("ssl", "ciphers", "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH").c_str());
|
||||
// handle configured flags
|
||||
bool ssl_flags = SSL_OP_NO_TICKET;
|
||||
if (!config->getBool("ssl", "ssl_v2", false))
|
||||
ssl_flags+=SSL_OP_NO_SSLv2;
|
||||
if (!config->getBool("ssl", "ssl_v3", false))
|
||||
@@ -278,6 +279,15 @@ int main(int argc , char *argv[]) {
|
||||
if (!config->getBool("ssl", "tls_v1_3", true))
|
||||
ssl_flags+=SSL_OP_NO_TLSv1_3;
|
||||
|
||||
if (!(ssl_flags & SSL_OP_NO_SSLv2) || !(ssl_flags & SSL_OP_NO_SSLv3))
|
||||
global_features.push_back("AUTH SSL");
|
||||
if (!(ssl_flags & SSL_OP_NO_TLSv1) || !(ssl_flags & SSL_OP_NO_TLSv1_1) ||
|
||||
!(ssl_flags & SSL_OP_NO_TLSv1_2) || !(ssl_flags & SSL_OP_NO_TLSv1_3))
|
||||
global_features.push_back("AUTH TLS");
|
||||
|
||||
global_features.push_back("PBSZ");
|
||||
global_features.push_back("PROT");
|
||||
|
||||
if ((ssl_flags & SSL_OP_NO_SSLv2) && (ssl_flags & SSL_OP_NO_SSLv3) &&
|
||||
(ssl_flags & SSL_OP_NO_TLSv1) && (ssl_flags & SSL_OP_NO_TLSv1_1) &&
|
||||
(ssl_flags & SSL_OP_NO_TLSv1_2) && (ssl_flags & SSL_OP_NO_TLSv1_3))
|
||||
@@ -413,8 +423,8 @@ int main(int argc , char *argv[]) {
|
||||
fds[slot].revents = 0;
|
||||
|
||||
fdc[slot].client = new Client(newsock);
|
||||
fdc[slot].client->addOption("SIZE", true);
|
||||
fdc[slot].client->addOption("UTF8", config->getBool("features", "utf8", true));
|
||||
for (const auto &o : client_options)
|
||||
fdc[slot].client->addFeature(o, "");
|
||||
fdc[slot].thread = new std::thread(runClient, &fdc[slot]);
|
||||
fdc[slot].close = false;
|
||||
|
||||
|
||||
Reference in new issue
Block a user