From e0036e9f0e0240541bf5a4ebcd8087be99739e71 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 8 May 2014 14:15:19 +0200 Subject: 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 Rebased-From: a60838d --- src/netbase.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/netbase.h') 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& 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 -- cgit v1.2.3