mirror of
https://github.com/fosrl/pangolin.git
synced 2026-06-07 16:18:47 +00:00
Send hp error to olm
This commit is contained in:
@@ -1,4 +1,8 @@
|
|||||||
import { sendToClient } from "#dynamic/routers/ws";
|
import { sendToClient } from "#dynamic/routers/ws";
|
||||||
|
import config from "@server/lib/config";
|
||||||
|
|
||||||
|
const udpPort = config.getRawConfig().gerbil.clients_start_port;
|
||||||
|
|
||||||
// Error codes for registration failures
|
// Error codes for registration failures
|
||||||
export const OlmErrorCodes = {
|
export const OlmErrorCodes = {
|
||||||
OLM_NOT_FOUND: {
|
OLM_NOT_FOUND: {
|
||||||
@@ -86,6 +90,10 @@ export const OlmErrorCodes = {
|
|||||||
TERMINATED_BLOCKED: {
|
TERMINATED_BLOCKED: {
|
||||||
code: "TERMINATED_BLOCKED",
|
code: "TERMINATED_BLOCKED",
|
||||||
message: "This session was terminated because access was blocked."
|
message: "This session was terminated because access was blocked."
|
||||||
|
},
|
||||||
|
HOLEPUNCH_MISSING: {
|
||||||
|
code: "HOLEPUNCH_MISSING",
|
||||||
|
message: `Hole punch information is missing. Please ensure your client can reach the server on UDP port ${udpPort} and try registering again.`
|
||||||
}
|
}
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
|||||||
@@ -327,6 +327,7 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => {
|
|||||||
`[handleOlmRegisterMessage] Client last hole punch is too old and we have sites to send; skipping this register. The client is failing to hole punch and identify its network address with the server. Can the client reach the server on UDP port ${config.getRawConfig().gerbil.clients_start_port}?`,
|
`[handleOlmRegisterMessage] Client last hole punch is too old and we have sites to send; skipping this register. The client is failing to hole punch and identify its network address with the server. Can the client reach the server on UDP port ${config.getRawConfig().gerbil.clients_start_port}?`,
|
||||||
{ orgId: client.orgId, clientId: client.clientId }
|
{ orgId: client.orgId, clientId: client.clientId }
|
||||||
);
|
);
|
||||||
|
sendOlmError(OlmErrorCodes.HOLEPUNCH_MISSING, olm.olmId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user