diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-10-10 23:40:00 +0200 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2023-10-10 23:40:00 +0200 |
commit | 1a7c572099edf744d6bb67318cff215de3fcd897 (patch) | |
tree | c9c106937b892ab0ef2c99394b7f7052dd1e53eb /src/session-initialize-bincimap-up.cc | |
parent | 2b4d7de34d173279fd8f09a25699d861c2b057ca (diff) |
turned Tools class into a namespace
use Tools::get/setenv in more places
Diffstat (limited to 'src/session-initialize-bincimap-up.cc')
-rw-r--r-- | src/session-initialize-bincimap-up.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/session-initialize-bincimap-up.cc b/src/session-initialize-bincimap-up.cc index c18ef26..a17a171 100644 --- a/src/session-initialize-bincimap-up.cc +++ b/src/session-initialize-bincimap-up.cc @@ -27,8 +27,6 @@ using namespace Binc; using std::string; -extern char **environ; - bool Session::initialize(int argc, char *argv[]) { IOFactory &ioFactory = IOFactory::getInstance(); @@ -61,9 +59,8 @@ bool Session::initialize(int argc, char *argv[]) session.assignCommandLineArgs(); // for log input - string ip = getenv("TCP6REMOTEIP") ? getenv("TCP6REMOTEIP") - : getenv("TCPREMOTEIP") ? getenv("TCPREMOTEIP") - : "?"; + string ip = Tools::getenv("TCP6REMOTEIP") + .value_or(Tools::getenv("TCPREMOTEIP").value_or("?")); session.setIP(ip); string logtype = session.getEnv("LOG_TYPE"); @@ -113,11 +110,11 @@ bool Session::initialize(int argc, char *argv[]) // imaps (port 993) -- requires sslserver with option -e int stls = 0; - if (getenv("SSL_SESSION_ID")) { + if (Tools::getenv("SSL_SESSION_ID")) { session.command.ssl = true; stls = -1; // else we will do starttls - requires new FDs - } else if (getenv("UCSPITLS")) { + } else if (Tools::getenv("UCSPITLS")) { string ucspitls = session.getEnv("UCSPITLS"); if (ucspitls == "+") stls = 1; if (ucspitls == "-") stls = 0; |