MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / SocksRequestFailed

Method SocksRequestFailed

libi2pd_client/SOCKS.cpp:324–342  ·  view source on GitHub ↗

All hope is lost beyond this point */

Source from the content-addressed store, hash-verified

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 {

Callers 2

ForwardSOCKSMethod · 0.80
SendUpstreamRequestMethod · 0.80

Calls 1

LogPrintFunction · 0.85

Tested by

no test coverage detected