check port

This commit is contained in:
Jeff Becker 2018-02-16 08:31:20 -05:00
parent b41a17d548
commit cdc5fce583
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

View File

@ -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);
}