sip: a header is found under its compact form, and with white space before the colon
RFC 3261 7.3.3 lets a sender write a header name in its one-letter form at any time and has every implementation accept both forms. The text layer matched the long name only, so to every reader a header sent in compact form was absent: the TCP framer took no body length from `l:` and read the body as the start of the next message, a response with `i:` matched no transaction and a request no call, the finals imsd builds left out a Via, From, To or Call-ID that came in compact form, and a short message whose content type came as `c:` was answered 200 and logged instead of taken (issue #2). MatchHeaderLine now takes a line under the name it is asked for or under that name's compact form: the ten RFC 3261 defines, and `o` for Event (RFC 6665) and `x` for Session-Expires (RFC 4028), the two extension headers imsd reads that have one. Every reader goes through it — Header, Headers, the framer, DatagramMessage — so no reader changes for it. It also takes white space between the name and the colon, which the same grammar allows (25.1's HCOLON; 7.3.1's "Subject : lunch") and the matcher refused. A value folded onto further lines is still read by its first line. One reader is changed for the rows it is now handed. ViaResponsePort gives the port the top Via names, to which the answer to a request that came in a datagram on a server port goes (RFC 3261 18.2.2), and none where that Via carries `rport` (RFC 3581): the answer then goes back to the port the request came from. It took `rport` for present where those five letters, in lower case, stood anywhere behind the row's first semicolon. Parameter names are case-insensitive (7.3.1), and a request whose top Via came as `v: …;RPORT`, a row 1.2.0 passed over, would have been answered to the port that Via names, its `rport` not seen. ViaResponsePort now reads the Via's parameters one by one, each to the next semicolon outside a quoted string, and `rport` is one by its name, in any case: not those letters in a value or in a longer name. Read so, the last parameter of the top value would run on into the next value where a row holds a list — `rport, SIP/2.0/UDP …` is no `rport`, and 1.2.0's search of the letters found it —, so the top value is cut from the row first, at the first comma outside a quoted string. With that cut a lower value's `rport` no longer counts for the top one's, as it did in 1.2.0 for a list on one line. Tested by the suites: tests/Sip pins each of the twelve forms through Header, in lower and in upper case, and through Headers, `l:` through the framer and DatagramMessage, 7.3.1's four spellings of the colon, and ViaResponsePort's reading of a Via row, `rport` by its name and of a list on one line the top value alone; tests/Engine drives an incoming call from an INVITE in compact form, an outgoing call from responses in compact form and a delivered MESSAGE in compact form through the reducers; tests/Messages builds BuildResponse, BuildResponse200 and BuildInviteResponse for a request in compact form. On the workstation's loopback (the fp6 journal's 2026-11-20-issues-2-5 capture, server-ports, at this commit and at the one before) a request on a server port whose Via row is a list on one line with `rport` on its lower value is answered from the client-port socket, the way to the port its top value names, where the commit before answered it from the socket it had come on. On the dev phone the binary of this range's last commit answered a MESSAGE the phone sent to its own protected server port from the client-port socket where its Via row was such a list, and from the socket it had come on where its one Via came as `v: …;RPORT` (the capture's phone-form6, inject-bench.log).
This commit is contained in:
parent
5c1fca12b9
commit
1267fe1ada
6 changed files with 367 additions and 48 deletions
|
|
@ -16,8 +16,8 @@ Covers: the unprotected + protected REGISTER and the refresh re-REGISTER
|
|||
an AMR-WB SDP offer and IMS MMTEL feature tags; the in-dialog PRACK/BYE and
|
||||
2xx/non-2xx ACK; CANCEL (reusing the INVITE branch); the 200 OK that echoes
|
||||
an inbound request's dialog headers; the finals of the inbound MESSAGE
|
||||
path, each `Via:` line echoed and the To tagged unless it holds `tag=`
|
||||
(RFC 3261 8.2.6.2; long header names only); the UAS responses to an
|
||||
path, each Via row echoed and the To tagged unless it holds `tag=`
|
||||
(RFC 3261 8.2.6.2); the UAS responses to an
|
||||
inbound INVITE (100/180/200
|
||||
and rejection finals); and the SIP MESSAGE that carries a short message's
|
||||
RP-DATA to the service centre, or its RP-ACK/RP-ERROR back to the IP-SM-GW
|
||||
|
|
@ -522,9 +522,8 @@ export namespace imsd::msg {
|
|||
}
|
||||
|
||||
// The final for an inbound MESSAGE outside a call's dialog — the 200 to one we took, the 480 or
|
||||
// 488 to one we did not: each `Via:` line echoed in order (the response
|
||||
// travels the proxy chain back, RFC 3261 8.2.6.2; long header names only,
|
||||
// not the compact forms), From, To with
|
||||
// 488 to one we did not: each Via row echoed in order (RFC 3261
|
||||
// 8.2.6.2), From, To with
|
||||
// `toTag` added unless the request's To holds `tag=` (8.2.6.2 again),
|
||||
// Call-ID and CSeq; no body. The shell's answers to any other request
|
||||
// outside a call but an INVITE (an OPTIONS, a NOTIFY, a method it does
|
||||
|
|
|
|||
Loading…
Reference in a new issue