CAP REQ from client to ZNC does not suspend registration #1004

Closed
opened 2026-10-05 04:58:08 +02:00 by adam · 1 comment
Owner

In the Client Capability Negotiation spec it says:

Upon receiving either a CAP LS or CAP REQ command during connection registration, the server MUST not complete registration until the client sends a CAP END command to indicate that capability negotiation has ended. This allows clients to request their desired capabilities before completing registration.

It seems that ZNC 1.8.2 suspends registration after CAP LS but not after CAP REQ.

In the [Client Capability Negotiation spec](https://ircv3.net/specs/extensions/capability-negotiation) it says: > Upon receiving either a `CAP LS` or `CAP REQ` command during connection registration, the server MUST not complete registration until the client sends a `CAP END` command to indicate that capability negotiation has ended. This allows clients to request their desired capabilities before completing registration. It seems that ZNC 1.8.2 suspends registration after `CAP LS` but not after `CAP REQ`. <!-- github-sync-id:1091830597 -->
adam closed this issue 2026-10-05 04:58:08 +02:00
Author
Owner

Something along the lines of the following should do it.

diff --git a/src/Client.cpp b/src/Client.cpp
index 1fdb2aa4..ddb18016 100644
--- a/src/Client.cpp
+++ b/src/Client.cpp
@@ -716,6 +716,8 @@ void CClient::HandleCap(const CMessage& Message) {
             }
         }
     } else if (sSubCmd.Equals("REQ")) {
+        m_bInCap = true;
+
         VCString vsTokens;
         Message.GetParam(1).Split(" ", vsTokens, false);
Something along the lines of the following should do it. ```diff diff --git a/src/Client.cpp b/src/Client.cpp index 1fdb2aa4..ddb18016 100644 --- a/src/Client.cpp +++ b/src/Client.cpp @@ -716,6 +716,8 @@ void CClient::HandleCap(const CMessage& Message) { } } } else if (sSubCmd.Equals("REQ")) { + m_bInCap = true; + VCString vsTokens; Message.GetParam(1).Split(" ", vsTokens, false); ``` <!-- github-comment-id:1003583901 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#1004