diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-05-08 14:15:19 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-05-23 16:03:43 +0200 |
commit | e0036e9f0e0240541bf5a4ebcd8087be99739e71 (patch) | |
tree | e885012bc41a9181cdaa5c1e7b65097d105b9c8f /src/netbase.h | |
parent | 2585310a2245b6ebffed3fe1318674b2f8eb5b82 (diff) | |
download | bitcoin-e0036e9f0e0240541bf5a4ebcd8087be99739e71.tar.xz |
Replace non-threadsafe strerror
Log the name of the error as well as the error code if a network problem
happens. This makes network troubleshooting more convenient.
Use thread-safe strerror_r and the WIN32 equivalent FormatMessage.
Conflicts:
src/netbase.cpp
Rebased-By: Wladimir van der Laan <laanwj@gmail.com>
Rebased-From: a60838d
Diffstat (limited to 'src/netbase.h')
-rw-r--r-- | src/netbase.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/netbase.h b/src/netbase.h index 95b1795767..b3358dcf01 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -149,5 +149,7 @@ bool Lookup(const char *pszName, std::vector<CService>& vAddr, int portDefault = bool LookupNumeric(const char *pszName, CService& addr, int portDefault = 0); bool ConnectSocket(const CService &addr, SOCKET& hSocketRet, int nTimeout = nConnectTimeout); bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest, int portDefault = 0, int nTimeout = nConnectTimeout); +/** Return readable error string for a network error code */ +std::string NetworkErrorString(int err); #endif |