aboutsummaryrefslogtreecommitdiff
path: root/src/netbase.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-05-08 14:15:19 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-05-23 16:03:43 +0200
commite0036e9f0e0240541bf5a4ebcd8087be99739e71 (patch)
treee885012bc41a9181cdaa5c1e7b65097d105b9c8f /src/netbase.h
parent2585310a2245b6ebffed3fe1318674b2f8eb5b82 (diff)
downloadbitcoin-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.h2
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