[-] Remove broadcast to reduce abuse

pull/109/head
Azalea 2025-01-16 17:47:55 -05:00
parent c5dbe778ea
commit aeab453e8b
2 changed files with 0 additions and 7 deletions

View File

@ -64,11 +64,6 @@ fun ActiveClient.handle(msg: Msg) {
lastHeartbeat = millis()
send(ctlMsg(Command.CTL_HEARTBEAT))
}
Command.DATA_BROADCAST -> {
// Broadcast to all clients. This is only used in UDP so SID is always 0
if (msg.proto != Proto.UDP) return log.warn("TCP Broadcast received, something is wrong.")
clients.values.forEach { it.send(msg.copy(src = stubIp)) }
}
Command.DATA_SEND, Command.CTL_TCP_ACCEPT_ACK -> {
target ?: return log.warn("Send: Target not found: ${msg.dst}")

View File

@ -8,11 +8,9 @@ import ext.str
object Command {
// Control plane
const val CTL_START = 1u
const val CTL_BIND = 2u
const val CTL_HEARTBEAT = 3u
const val CTL_TCP_CONNECT = 4u // Accept a new multiplexed TCP stream
const val CTL_TCP_ACCEPT = 5u
const val CTL_TCP_ACCEPT_ACK = 6u
const val CTL_TCP_CLOSE = 7u
// Data plane