All hope is lost beyond this point */
| 322 | |
| 323 | /* All hope is lost beyond this point */ |
| 324 | void SOCKSHandler::SocksRequestFailed(SOCKSHandler::errTypes error) |
| 325 | { |
| 326 | boost::asio::const_buffer response(nullptr,0); |
| 327 | assert(error != SOCKS4_OK && error != SOCKS5_OK); |
| 328 | switch (m_socksv) |
| 329 | { |
| 330 | case SOCKS4: |
| 331 | LogPrint(eLogWarning, "SOCKS: v4 request failed: ", error); |
| 332 | if (error < SOCKS4_OK) error = SOCKS4_FAIL; // Transparently map SOCKS5 errors |
| 333 | response = GenerateSOCKS4Response(error, m_4aip, m_port); |
| 334 | break; |
| 335 | case SOCKS5: |
| 336 | LogPrint(eLogWarning, "SOCKS: v5 request failed: ", error); |
| 337 | response = GenerateSOCKS5Response(error, m_addrtype, m_address, m_port); |
| 338 | break; |
| 339 | } |
| 340 | boost::asio::async_write(*m_sock, response, std::bind(&SOCKSHandler::SentSocksFailed, |
| 341 | shared_from_this(), std::placeholders::_1)); |
| 342 | } |
| 343 | |
| 344 | void SOCKSHandler::SocksRequestSuccess() |
| 345 | { |
no test coverage detected