From d48389012a4648477a2a37becfed2b4a5264a0b7 Mon Sep 17 00:00:00 2001 From: Brett Jia Date: Wed, 21 Aug 2024 13:51:56 -0400 Subject: [PATCH] signaling: configurable buffer sizes via macros --- src/agent.h | 8 ++++++++ src/peer_signaling.c | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/agent.h b/src/agent.h index fe1b9e9..73a1fc5 100644 --- a/src/agent.h +++ b/src/agent.h @@ -16,9 +16,17 @@ #include "ice.h" #include "base64.h" +#ifndef AGENT_MAX_DESCRIPTION #define AGENT_MAX_DESCRIPTION 40960 +#endif + +#ifndef AGENT_MAX_CANDIDATES #define AGENT_MAX_CANDIDATES 10 +#endif + +#ifndef AGENT_MAX_CANDIDATE_PAIRS #define AGENT_MAX_CANDIDATE_PAIRS 100 +#endif typedef enum AgentState { diff --git a/src/peer_signaling.c b/src/peer_signaling.c index 6f9cc33..8a7f661 100644 --- a/src/peer_signaling.c +++ b/src/peer_signaling.c @@ -16,7 +16,11 @@ #define KEEP_ALIVE_TIMEOUT_SECONDS 60 #define CONNACK_RECV_TIMEOUT_MS 1000 + +#ifndef BUF_SIZE #define BUF_SIZE 4096 +#endif + #define TOPIC_SIZE 128 #define HOST_LEN 64