mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-31 17:50:47 +02:00
Handle the ping exit node request backward mode for olm and install handler
This commit is contained in:
@@ -58,9 +58,17 @@ export const handleOlmRegisterMessage: MessageHandler = async (context) => {
|
|||||||
pingResults,
|
pingResults,
|
||||||
fingerprint,
|
fingerprint,
|
||||||
postures,
|
postures,
|
||||||
|
backwardsCompatible,
|
||||||
chainId
|
chainId
|
||||||
} = message.data;
|
} = message.data;
|
||||||
|
|
||||||
|
if (backwardsCompatible) {
|
||||||
|
logger.debug(
|
||||||
|
"[handleOlmRegisterMessage] Backwards compatible mode detected - not sending connect message and waiting for ping response."
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!olm.clientId) {
|
if (!olm.clientId) {
|
||||||
logger.warn("[handleOlmRegisterMessage] Olm client ID not found");
|
logger.warn("[handleOlmRegisterMessage] Olm client ID not found");
|
||||||
sendOlmError(OlmErrorCodes.CLIENT_ID_NOT_FOUND, olm.olmId);
|
sendOlmError(OlmErrorCodes.CLIENT_ID_NOT_FOUND, olm.olmId);
|
||||||
|
|||||||
@@ -15,3 +15,4 @@ export * from "./handleOlmServerInitAddPeerHandshake";
|
|||||||
export * from "./offlineChecker";
|
export * from "./offlineChecker";
|
||||||
export * from "./handleOlmUnLocalMessage";
|
export * from "./handleOlmUnLocalMessage";
|
||||||
export * from "./handleOlmLocalMessage";
|
export * from "./handleOlmLocalMessage";
|
||||||
|
export * from "./handleOlmExitNodesRequestMessage";
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ import {
|
|||||||
handleOlmDisconnectingMessage,
|
handleOlmDisconnectingMessage,
|
||||||
handleOlmServerInitAddPeerHandshake,
|
handleOlmServerInitAddPeerHandshake,
|
||||||
handleOlmLocalMessage,
|
handleOlmLocalMessage,
|
||||||
handleOlmUnLocalMessage
|
handleOlmUnLocalMessage,
|
||||||
|
handleOlmExitNodesRequestMessage
|
||||||
} from "../olm";
|
} from "../olm";
|
||||||
import { handleHealthcheckStatusMessage } from "../target";
|
import { handleHealthcheckStatusMessage } from "../target";
|
||||||
import { handleRoundTripMessage } from "./handleRoundTripMessage";
|
import { handleRoundTripMessage } from "./handleRoundTripMessage";
|
||||||
@@ -37,6 +38,7 @@ export const messageHandlers: Record<string, MessageHandler> = {
|
|||||||
"olm/wg/local": handleOlmLocalMessage,
|
"olm/wg/local": handleOlmLocalMessage,
|
||||||
"olm/wg/unlocal": handleOlmUnLocalMessage,
|
"olm/wg/unlocal": handleOlmUnLocalMessage,
|
||||||
"olm/ping": handleOlmPingMessage,
|
"olm/ping": handleOlmPingMessage,
|
||||||
|
"olm/ping/request": handleOlmExitNodesRequestMessage,
|
||||||
"olm/disconnecting": handleOlmDisconnectingMessage,
|
"olm/disconnecting": handleOlmDisconnectingMessage,
|
||||||
"newt/disconnecting": handleNewtDisconnectingMessage,
|
"newt/disconnecting": handleNewtDisconnectingMessage,
|
||||||
"newt/ping": handleNewtPingMessage,
|
"newt/ping": handleNewtPingMessage,
|
||||||
|
|||||||
Reference in New Issue
Block a user