aboutsummaryrefslogtreecommitdiff
path: root/src/netbase.h
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2012-09-23 12:55:05 +0200
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2012-10-04 09:35:24 +0200
commit81bbef26099eb54f4dcc32e45b5e0416857a330d (patch)
treeebccf84ff2f56d1f6e02fbb410cc39b65c3fed6b /src/netbase.h
parent0547b02af78dcf2d84e4905b56c7f95d9582b2f9 (diff)
downloadbitcoin-81bbef26099eb54f4dcc32e45b5e0416857a330d.tar.xz
add LOCK() for proxy related data-structures
- fix #1560 by properly locking proxy related data-structures - update GetProxy() and introduce GetNameProxy() to be able to use a thread-safe local copy from proxyInfo and nameproxyInfo - update usage of GetProxy() all over the source to match the new behaviour, as it now fills a full proxyType object - rename GetNameProxy() into HaveNameProxy() to be more clear
Diffstat (limited to 'src/netbase.h')
-rw-r--r--src/netbase.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/netbase.h b/src/netbase.h
index 560e2182df..0a29d4ff0c 100644
--- a/src/netbase.h
+++ b/src/netbase.h
@@ -133,13 +133,15 @@ class CService : public CNetAddr
)
};
+typedef std::pair<CService, int> proxyType;
+
enum Network ParseNetwork(std::string net);
void SplitHostPort(std::string in, int &portOut, std::string &hostOut);
bool SetProxy(enum Network net, CService addrProxy, int nSocksVersion = 5);
-bool GetProxy(enum Network net, CService &addrProxy);
+bool GetProxy(enum Network net, proxyType &proxyInfoOut);
bool IsProxy(const CNetAddr &addr);
bool SetNameProxy(CService addrProxy, int nSocksVersion = 5);
-bool GetNameProxy();
+bool HaveNameProxy();
bool LookupHost(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions = 0, bool fAllowLookup = true);
bool LookupHostNumeric(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions = 0);
bool Lookup(const char *pszName, CService& addr, int portDefault = 0, bool fAllowLookup = true);