mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-04-13 11:16:06 +00:00
Assert that the port numbers are set prior to being used
This commit is contained in:
@@ -1142,6 +1142,8 @@ int startControlStream(void) {
|
||||
ENetAddress address;
|
||||
ENetEvent event;
|
||||
|
||||
LC_ASSERT(ControlPortNumber != 0);
|
||||
|
||||
enet_address_set_address(&address, (struct sockaddr *)&RemoteAddr, RemoteAddrLen);
|
||||
enet_address_set_port(&address, ControlPortNumber);
|
||||
|
||||
@@ -1183,6 +1185,7 @@ int startControlStream(void) {
|
||||
}
|
||||
else {
|
||||
// NB: Do NOT use ControlPortNumber here. 47995 is correct for these old versions.
|
||||
LC_ASSERT(ControlPortNumber == 0);
|
||||
ctlSock = connectTcpSocket(&RemoteAddr, RemoteAddrLen,
|
||||
47995, CONTROL_STREAM_TIMEOUT_SEC);
|
||||
if (ctlSock == INVALID_SOCKET) {
|
||||
|
||||
Reference in New Issue
Block a user