mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-08-15 09:10:39 +00:00
check if socket gets closed before creating sockets pipe. Catch set_option exception
This commit is contained in:
@@ -831,6 +831,15 @@ namespace proxy
|
||||
template<typename Socket>
|
||||
void SOCKSHandler::SocksUpstreamSuccess(std::shared_ptr<Socket>& upstreamSock)
|
||||
{
|
||||
if (!m_sock->is_open ())
|
||||
{
|
||||
// check if the socket got closed during upstream handshake
|
||||
LogPrint(eLogWarning, "SOCKS: Can't link to upstream because socket is closed");
|
||||
upstreamSock = nullptr;
|
||||
m_sock = nullptr;
|
||||
Terminate();
|
||||
return;
|
||||
}
|
||||
LogPrint(eLogInfo, "SOCKS: Upstream success");
|
||||
boost::asio::const_buffer response(nullptr, 0);
|
||||
switch (m_socksv)
|
||||
|
||||
Reference in New Issue
Block a user