From 39d4b4128f1a544e355b34ffea05ef15f1c9ef01 Mon Sep 17 00:00:00 2001 From: jrd Date: Sat, 18 Apr 2026 16:35:04 +0000 Subject: [PATCH] fix: use display version in server registration to avoid exceeding MAX_LEN_VERSION_TEXT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dev builds from a dirty git tree produce APP_VERSION strings like "3.11.0dev--dirty:" which can exceed MAX_LEN_VERSION_TEXT (30 chars). The receiving directory's GetStringFromStream returns an error on oversized strings, silently dropping the registration packet with no response — the registering server sees only timeouts and eventually "Registration failed". VERSION (GetDisplayVersion(APP_VERSION)) strips the :timestamp build artifact and is the appropriate form for protocol/display use. Clean git builds happen to stay just under the limit (28 chars), so this was never caught in CI. Co-Authored-By: Claude Sonnet 4.6 --- src/protocol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protocol.cpp b/src/protocol.cpp index 47be8bc265..2011d2dd99 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -1864,7 +1864,7 @@ void CProtocol::CreateCLRegisterServerExMes ( const CHostAddress& InetAddr, cons const QByteArray strUTF8LInetAddr = LInetAddr.InetAddr.toString().toUtf8(); const QByteArray strUTF8Name = ServerInfo.strName.toUtf8(); const QByteArray strUTF8City = ServerInfo.strCity.toUtf8(); - const QByteArray strUTF8Version = QString ( APP_VERSION ).toUtf8(); + const QByteArray strUTF8Version = QString ( VERSION ).toUtf8(); // size of current message body const int iEntrLen = 2 + // server internal port number