imsd: what the client flow already holds is read before an SMS wait is judged

The run loop judged the wait of the message in flight — its MESSAGE's
final, its submit report — after draining the server ports and before
its read of the client flow. A final that had arrived in time and was
still unread at that pass counted as none: the segment was sent again —
before the repeat existed, the message failed — and the final then
found nothing to own (issue #3, the third of its three cases).

The pass now reads what the flow holds, without waiting, before it
judges: SipFlow::RecvReady returns a message that is whole in the frame
buffer or readable on the socket now. RecvMsg's read of the socket
moved into a helper both use (ReadOnce), and the handling of a message
read from the flow into OnFlowMessage, for the loop's two reads.

Tested on the workstation's loopback with the daemon's own SipFlow built
around a bench main (the fp6 journal's 2026-11-20-issues-2-5 capture,
flow-read): over TCP and over UDP RecvReady returns a message the socket
holds without waiting and none when it holds none, and RecvMsg waits its
time and returns a message when one comes; over TCP RecvReady leaves a
message that is not whole yet. On the dev phone the binary of this
range's last commit judged a report's wait at that pass, 130.06 s after
the final, and sent the repeat (the capture's phone-form6,
visit-journal.txt); the pass has not run with a final waiting unread:
that takes a final timed to it.
This commit is contained in:
Jorijn van der Graaf 2026-11-22 17:35:13 +01:00
commit 1fa4d77fcd
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
2 changed files with 111 additions and 57 deletions

View file

@ -151,7 +151,8 @@ status-report book's entries (made at a message's start, and only for one
that asked for a report: `StartNextSms`), the routing of a MESSAGE
final to the message in flight (`OnSmsResponse` — ahead of the reg-event
subscription's handler in the run loop, after it inside `AwaitFinal`), the
judgement of the final's wait and of the report's after the server ports' drain, the reassembler's
judgement of the final's wait and of the report's after the server ports' drain and the read of what
the client flow already holds, the reassembler's
30-minute age-out in the run loop, the retransmission check around
`OnSmsMessage`, the delivery reports' finals (`reportCallIds_`), a send
failure attributed by Call-ID, and the forwarding of a status report's
@ -763,7 +764,17 @@ Rules:
a 408, a 504 or an RP-ERROR; a repeat rejected as a duplicate, and one
ended in its turn; the first attempt's report after its repeat went
out.
`tests/Engine` pins the reducer for each.
`tests/Engine` pins the reducer for each. The read of the client flow before a wait is
judged: `SipFlow`'s two reads ran on the workstation's loopback, the
daemon's class built around a bench `main` (2026-11-20 to 2026-11-22,
the fp6 journal's `2026-11-20-issues-2-5` capture, `flow-read`: over TCP and
over UDP `RecvReady` returns a message the socket holds without
waiting and none when it holds none, and `RecvMsg` waits its time and
returns a message when one comes; over TCP `RecvReady` leaves a
message that is not whole yet; over UDP it passes a keepalive's CRLFs
over); the run loop around them judged a wait on the dev phone (the
report's, in the repeat's bench above), and has not run with a final
waiting unread at that pass.
- A request cut short of its Content-Length on the client flow ran on the
workstation's loopback (2026-11-22, the fp6 journal's
`2026-11-20-issues-2-5` capture, `cut-short`: `SipFlow` built around a
@ -1940,8 +1951,9 @@ do that answers without state.
reason — after a repeat the repeat's end and the first attempt's —, at
once: a report that still comes for the first attempt is then answered
and logged (Receiving, below) and changes nothing; a wait is judged at the run loop's passes,
after the server ports are read, so an answer read before that counts
however late. Not done of the clause's repeat: it cannot be switched off
after the server ports are read and what the client flow already holds
is (`SipFlow::RecvReady`, without waiting), so a final that
the flow held when it was read counts, however late. Not done of the clause's repeat: it cannot be switched off
("should be capable of being disabled through MMI"), and a failed
message is not kept for the user to send again under its TP-MR — a
`Send` of the same text is a new message with the next TP-MR, which the