SIP: header names in compact form are not read #2
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Catcrafts/imsd#2
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
RFC 3261 7.3.3 lets a sender write a header name in its one-letter form "at any time" (
vVia,fFrom,tTo,iCall-ID,mContact,cContent-Type,lContent-Length,kSupported,eContent-Encoding,sSubject), and says: "Implementations MUST accept both the long and short forms of each header name."imsd's text layer matches the long name only (
MatchHeaderLine,interfaces/Imsd-Sip.cppm). To every reader, a header sent in compact form is absent:Content-Length(FrameBuffer::TryExtract). A message that saysl:is cut after its headers, and its body is read as the start of the next message.Call-ID(ResponseOf,DispatchRequest). Withi:a response matches no transaction of ours and a request no call.Via,From,To,Call-IDandCSeqfrom the request (BuildResponse200,BuildInviteResponse; from 1.2.0BuildResponse). One that came in compact form is left out of the answer.c:is not taken for a short message — it is answered 200 and logged with its body, not handed to the bus and not acknowledged with an RP-ACK. One whose Call-ID comes asi:gets a delivery report withoutIn-Reply-To. One whose Via comes asv:is never recognised as a retransmission.None of the SIP messages captured from KPN, the network imsd is benched on, uses a compact form, and a core that used them throughout would not get imsd as far as a registration. The case that matters is a network element that uses them in some requests only.
1.2.0's AGENTS.md says so (§2: "the text layer reads long header names only"; §7.9). Before that the documents do not mention it.
What a fix needs:
ofor Event andxfor Session-Expires are two).Header,Headers, the framer andDatagramMessage, and the suites that drive requests through the reducers get a fixture in compact form.Fixed in 1.2.1. A header is found under its compact form — the ten RFC 3261 defines,
ofor Event andxfor Session-Expires — and with white space before the colon (1267fe1). In the same release: a response's CSeq is compared as its number and its method (78c7025), both framers read a Content-Length as a number (c81dd3d), and a header value folded over several lines is read whole (9333621).