From 43cdd649560a19ee93e9d827fb935c80855a0715 Mon Sep 17 00:00:00 2001 From: Doug Hoyte Date: Sun, 5 Feb 2023 15:41:59 -0500 Subject: [PATCH] increase max subscription ID length, needed for hamstr client --- src/Subscription.h | 6 +++--- src/constants.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Subscription.h b/src/Subscription.h index 181be44..4ffe786 100644 --- a/src/Subscription.h +++ b/src/Subscription.h @@ -6,11 +6,11 @@ struct SubId { - char buf[64]; + char buf[72]; SubId(std::string_view val) { - static_assert(MAX_SUBID_SIZE == 63, "MAX_SUBID_SIZE mismatch"); - if (val.size() > 63) throw herr("subscription id too long"); + static_assert(MAX_SUBID_SIZE == 71, "MAX_SUBID_SIZE mismatch"); + if (val.size() > 71) throw herr("subscription id too long"); if (val.size() == 0) throw herr("subscription id too short"); auto badChar = [](char c){ diff --git a/src/constants.h b/src/constants.h index 89ea623..831e58f 100644 --- a/src/constants.h +++ b/src/constants.h @@ -1,4 +1,4 @@ #pragma once -const size_t MAX_SUBID_SIZE = 63; // Statically allocated size in SubId +const size_t MAX_SUBID_SIZE = 71; // Statically allocated size in SubId const uint64_t MAX_TIMESTAMP = 17179869184; // Safety limit to ensure it can fit in quadrable key. Good until year 2514.