Skip to content

Commit b887676

Browse files
committed
net: remove now-unused functions
1 parent 45fd754 commit b887676

File tree

2 files changed

+0
-43
lines changed

2 files changed

+0
-43
lines changed

src/netbase.cpp

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -558,47 +558,6 @@ bool ConnectThroughProxy(const proxyType &proxy, const std::string& strDest, int
558558
hSocketRet = hSocket;
559559
return true;
560560
}
561-
562-
bool ConnectSocket(const CService &addrDest, SOCKET& hSocketRet, int nTimeout, bool *outProxyConnectionFailed)
563-
{
564-
proxyType proxy;
565-
if (outProxyConnectionFailed)
566-
*outProxyConnectionFailed = false;
567-
568-
if (GetProxy(addrDest.GetNetwork(), proxy))
569-
return ConnectThroughProxy(proxy, addrDest.ToStringIP(), addrDest.GetPort(), hSocketRet, nTimeout, outProxyConnectionFailed);
570-
else // no proxy needed (none set for target network)
571-
return ConnectSocketDirectly(addrDest, hSocketRet, nTimeout);
572-
}
573-
574-
bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest, int portDefault, int nTimeout, bool *outProxyConnectionFailed)
575-
{
576-
std::string strDest;
577-
int port = portDefault;
578-
579-
if (outProxyConnectionFailed)
580-
*outProxyConnectionFailed = false;
581-
582-
SplitHostPort(std::string(pszDest), port, strDest);
583-
584-
proxyType proxy;
585-
GetNameProxy(proxy);
586-
587-
std::vector<CService> addrResolved;
588-
if (Lookup(strDest.c_str(), addrResolved, port, fNameLookup && !HaveNameProxy(), 256)) {
589-
if (addrResolved.size() > 0) {
590-
addr = addrResolved[GetRand(addrResolved.size())];
591-
return ConnectSocket(addr, hSocketRet, nTimeout);
592-
}
593-
}
594-
595-
addr = CService();
596-
597-
if (!HaveNameProxy())
598-
return false;
599-
return ConnectThroughProxy(proxy, strDest, port, hSocketRet, nTimeout, outProxyConnectionFailed);
600-
}
601-
602561
bool LookupSubNet(const char* pszName, CSubNet& ret)
603562
{
604563
std::string strSubnet(pszName);

src/netbase.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ bool Lookup(const char *pszName, CService& addr, int portDefault, bool fAllowLoo
5151
bool Lookup(const char *pszName, std::vector<CService>& vAddr, int portDefault, bool fAllowLookup, unsigned int nMaxSolutions);
5252
CService LookupNumeric(const char *pszName, int portDefault = 0);
5353
bool LookupSubNet(const char *pszName, CSubNet& subnet);
54-
bool ConnectSocket(const CService &addr, SOCKET& hSocketRet, int nTimeout, bool *outProxyConnectionFailed = nullptr);
55-
bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest, int portDefault, int nTimeout, bool *outProxyConnectionFailed = nullptr);
5654
bool ConnectSocketDirectly(const CService &addrConnect, SOCKET& hSocketRet, int nTimeout);
5755
bool ConnectThroughProxy(const proxyType &proxy, const std::string& strDest, int port, SOCKET& hSocketRet, int nTimeout, bool *outProxyConnectionFailed);
5856
/** Return readable error string for a network error code */

0 commit comments

Comments
 (0)