mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-08-10 00:52:16 +00:00
Require RTSP encryption when encryption mode is set to mandatory
This also lets us provide a friendly error to the client when it is rejected.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
* @brief todo
|
||||
*/
|
||||
#include "network.h"
|
||||
#include "config.h"
|
||||
#include "utility.h"
|
||||
#include <algorithm>
|
||||
|
||||
@@ -174,6 +175,22 @@ namespace net {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the encryption mode for the given remote endpoint address.
|
||||
* @param address The address used to look up the desired encryption mode.
|
||||
* @return The WAN or LAN encryption mode, based on the provided address.
|
||||
*/
|
||||
int
|
||||
encryption_mode_for_address(boost::asio::ip::address address) {
|
||||
auto nettype = net::from_address(address.to_string());
|
||||
if (nettype == net::net_e::PC || nettype == net::net_e::LAN) {
|
||||
return config::stream.lan_encryption_mode;
|
||||
}
|
||||
else {
|
||||
return config::stream.wan_encryption_mode;
|
||||
}
|
||||
}
|
||||
|
||||
host_t
|
||||
host_create(af_e af, ENetAddress &addr, std::size_t peers, std::uint16_t port) {
|
||||
static std::once_flag enet_init_flag;
|
||||
|
||||
Reference in New Issue
Block a user