diff options
author | Peter Powell <petpow@saberuk.com> | 2018-04-14 15:43:03 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2018-04-16 15:29:55 +0100 |
commit | 780dda83ba3857bc3c330d4b5d38bb251a9d879b (patch) | |
tree | 75034915142a3e1362f0f9d59c8e96e1eec22931 /src/modules/extra | |
parent | 2d36fcb16ef3209fffbe9f4b600971a1edd2ae4b (diff) |
Add ConfigTag::getUInt for reading unsigned config values.
Diffstat (limited to 'src/modules/extra')
-rw-r--r-- | src/modules/extra/m_mysql.cpp | 2 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 6 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_mbedtls.cpp | 8 | ||||
-rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index 6c65cd87e..0a7d4d993 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -272,7 +272,7 @@ class SQLConnection : public SQL::Provider std::string user = config->getString("user"); std::string pass = config->getString("pass"); std::string dbname = config->getString("name"); - int port = config->getInt("port", 3306); + unsigned int port = config->getUInt("port", 3306); bool rv = mysql_real_connect(connection, host.c_str(), user.c_str(), pass.c_str(), dbname.c_str(), port, NULL, 0); if (!rv) return rv; diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 56b60de26..51410cfb2 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -650,7 +650,7 @@ namespace GnuTLS , keystr(ReadFile(tag->getString("keyfile", "key.pem"))) , dh(DHParams::Import(ReadFile(tag->getString("dhfile", "dhparams.pem")))) , priostr(GetPrioStr(profilename, tag)) - , mindh(tag->getInt("mindhbits", 1024)) + , mindh(tag->getUInt("mindhbits", 1024)) , hashstr(tag->getString("hash", "md5")) , requestclientcert(tag->getBool("requestclientcert", true)) { @@ -667,9 +667,9 @@ namespace GnuTLS #ifdef INSPIRCD_GNUTLS_HAS_CORK // If cork support is available outrecsize represents the (rough) max amount of data we give GnuTLS while corked - outrecsize = tag->getInt("outrecsize", 2048, 512); + outrecsize = tag->getUInt("outrecsize", 2048, 512); #else - outrecsize = tag->getInt("outrecsize", 2048, 512, 16384); + outrecsize = tag->getUInt("outrecsize", 2048, 512, 16384); #endif } }; diff --git a/src/modules/extra/m_ssl_mbedtls.cpp b/src/modules/extra/m_ssl_mbedtls.cpp index 391d4d79b..8bb0e2bbd 100644 --- a/src/modules/extra/m_ssl_mbedtls.cpp +++ b/src/modules/extra/m_ssl_mbedtls.cpp @@ -410,12 +410,12 @@ namespace mbedTLS , dhstr(ReadFile(tag->getString("dhfile", "dhparams.pem"))) , ciphersuitestr(tag->getString("ciphersuites")) , curvestr(tag->getString("curves")) - , mindh(tag->getInt("mindhbits", 2048)) + , mindh(tag->getUInt("mindhbits", 2048)) , hashstr(tag->getString("hash", "sha256")) , castr(tag->getString("cafile")) - , minver(tag->getInt("minver", 0)) - , maxver(tag->getInt("maxver", 0)) - , outrecsize(tag->getInt("outrecsize", 2048, 512, 16384)) + , minver(tag->getUInt("minver", 0)) + , maxver(tag->getUInt("maxver", 0)) + , outrecsize(tag->getUInt("outrecsize", 2048, 512, 16384)) , requestclientcert(tag->getBool("requestclientcert", true)) { if (!castr.empty()) diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 828fcc26a..a70bffb3c 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -359,7 +359,7 @@ namespace OpenSSL , ctx(SSL_CTX_new(SSLv23_server_method())) , clictx(SSL_CTX_new(SSLv23_client_method())) , allowrenego(tag->getBool("renegotiation")) // Disallow by default - , outrecsize(tag->getInt("outrecsize", 2048, 512, 16384)) + , outrecsize(tag->getUInt("outrecsize", 2048, 512, 16384)) { if ((!ctx.SetDH(dh)) || (!clictx.SetDH(dh))) throw Exception("Couldn't set DH parameters"); |