diff options
| author | Philip Kaufmann <[email protected]> | 2012-09-23 12:55:05 +0200 |
|---|---|---|
| committer | Philip Kaufmann <[email protected]> | 2012-10-04 09:35:24 +0200 |
| commit | 81bbef26099eb54f4dcc32e45b5e0416857a330d (patch) | |
| tree | ebccf84ff2f56d1f6e02fbb410cc39b65c3fed6b /src/netbase.h | |
| parent | Merge branch '2012_09_fixwformat' of github.com:laanwj/bitcoin (diff) | |
| download | discoin-81bbef26099eb54f4dcc32e45b5e0416857a330d.tar.xz discoin-81bbef26099eb54f4dcc32e45b5e0416857a330d.zip | |
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.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/netbase.h b/src/netbase.h index 560e2182d..0a29d4ff0 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); |