From: CryptoManiac Date: Sun, 21 Feb 2016 18:16:04 +0000 (+0300) Subject: Merge pull request #282 from svost/from-bitcoin X-Git-Tag: nvc-v0.5.6~57 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=058224d9ea6a9e8d7df6269c97b52535bd659ff9;hp=28912e9c4dd7a21cc1f4225bfd5c03a708785ea8 Merge pull request #282 from svost/from-bitcoin From bitcoin --- diff --git a/src/netbase.cpp b/src/netbase.cpp index a9caddf..9bf5fe9 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -136,11 +136,6 @@ bool LookupHost(const char *pszName, std::vector& vIP, unsigned int nM return LookupIntern(strHost.c_str(), vIP, nMaxSolutions, fAllowLookup); } -bool LookupHostNumeric(const char *pszName, std::vector& vIP, unsigned int nMaxSolutions) -{ - return LookupHost(pszName, vIP, nMaxSolutions, false); -} - bool Lookup(const char *pszName, std::vector& vAddr, uint16_t portDefault, bool fAllowLookup, unsigned int nMaxSolutions) { if (pszName[0] == 0) @@ -252,7 +247,7 @@ bool static Socks5(string strDest, uint16_t port, SOCKET& hSocket) strSocks5 += strDest; strSocks5 += static_cast((port >> 8) & 0xFF); strSocks5 += static_cast((port >> 0) & 0xFF); - ret = send(hSocket, strSocks5.c_str(), strSocks5.size(), MSG_NOSIGNAL); + ret = send(hSocket, strSocks5.data(), strSocks5.size(), MSG_NOSIGNAL); if (ret != (ssize_t)strSocks5.size()) { CloseSocket(hSocket); diff --git a/src/netbase.h b/src/netbase.h index 0f562ca..7e995f6 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -143,7 +143,6 @@ bool IsProxy(const CNetAddr &addr); bool SetNameProxy(CService addrProxy, int nSocksVersion = 5); bool HaveNameProxy(); bool LookupHost(const char *pszName, std::vector& vIP, unsigned int nMaxSolutions = 0, bool fAllowLookup = true); -bool LookupHostNumeric(const char *pszName, std::vector& vIP, unsigned int nMaxSolutions = 0); bool Lookup(const char *pszName, CService& addr, uint16_t portDefault = 0, bool fAllowLookup = true); bool Lookup(const char *pszName, std::vector& vAddr, uint16_t portDefault = 0, bool fAllowLookup = true, unsigned int nMaxSolutions = 0); bool LookupNumeric(const char *pszName, CService& addr, uint16_t portDefault = 0); diff --git a/src/util.cpp b/src/util.cpp index 73621d8..0f84938 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -31,6 +31,7 @@ namespace boost { #include #include #include +#include #ifdef WIN32 #ifdef _MSC_VER @@ -127,6 +128,13 @@ public: ppmutexOpenSSL[i] = new CCriticalSection(); CRYPTO_set_locking_callback(locking_callback); + // OpenSSL can optionally load a config file which lists optional loadable modules and engines. + // We don't use them so we don't require the config. However some of our libs may call functions + // which attempt to load the config file, possibly resulting in an exit() or crash if it is missing + // or corrupt. Explicitly tell OpenSSL not to try to load the file. The result for our libs will be + // that the config appears to have been loaded and there are no modules/engines available. + OPENSSL_no_config(); + #ifdef WIN32 // Seed random number generator with screen scrape and other hardware sources RAND_screen();