Browse Source

check port

pull/1114/head
Jeff Becker 7 years ago
parent
commit
cdc5fce583
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
  1. 5
      libi2pd_client/WebSocks.cpp

5
libi2pd_client/WebSocks.cpp

@ -248,10 +248,15 @@ namespace client @@ -248,10 +248,15 @@ namespace client
m_State = eWSCTryConnect;
m_Parent->CreateStreamTo(m_RemoteAddr, m_RemotePort, std::bind(&WebSocksConn::ConnectResult, this, std::placeholders::_1));
} else if (state == eWSCDatagram) {
if (m_RemotePort >= 0 && m_RemotePort <= 65535)
{
LogPrint(eLogDebug, "websocks: datagram mode initiated");
m_State = eWSCDatagram;
BeginDatagram();
SendResponse("");
}
else
SendResponse("invalid port");
} else {
LogPrint(eLogWarning, "websocks: invalid state change ", m_State, " -> ", state);
}

Loading…
Cancel
Save