mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
Use Socks5ErrorString() to decode error responses from socks proxy.
This commit is contained in:
parent
50d393b95b
commit
785e36ea18
1 changed files with 1 additions and 12 deletions
|
|
@ -360,18 +360,7 @@ static bool Socks5(const std::string& strDest, int port, const ProxyCredentials
|
|||
if (pchRet2[1] != 0x00) {
|
||||
// Failures to connect to a peer that are not proxy errors
|
||||
CloseSocket(hSocket);
|
||||
switch (pchRet2[1])
|
||||
{
|
||||
case 0x01: LogPrintf("Socks5() connect to %s:%d failed: general failure\n", strDest, port); break;
|
||||
case 0x02: LogPrintf("Socks5() connect to %s:%d failed: connection not allowed\n", strDest, port); break;
|
||||
case 0x03: LogPrintf("Socks5() connect to %s:%d failed: network unreachable\n", strDest, port); break;
|
||||
case 0x04: LogPrintf("Socks5() connect to %s:%d failed: host unreachable\n", strDest, port); break;
|
||||
case 0x05: LogPrintf("Socks5() connect to %s:%d failed: connection refused\n", strDest, port); break;
|
||||
case 0x06: LogPrintf("Socks5() connect to %s:%d failed: TTL expired\n", strDest, port); break;
|
||||
case 0x07: LogPrintf("Socks5() connect to %s:%d failed: protocol error\n", strDest, port); break;
|
||||
case 0x08: LogPrintf("Socks5() connect to %s:%d failed: address type not supported\n", strDest, port); break;
|
||||
default: LogPrintf("Socks5() connect to %s:%d failed: unknown\n", strDest, port);
|
||||
}
|
||||
LogPrintf("Socks5() connect to %s:%d failed: %s\n", strDest, port, Socks5ErrorString(pchRet2[1]));
|
||||
return false;
|
||||
}
|
||||
if (pchRet2[2] != 0x00) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue