Skip to content

transport: log parse failures at Debug without the payload - #341

Open
Mliviu79 wants to merge 1 commit into
emiago:mainfrom
Mliviu79:pr/parselog
Open

transport: log parse failures at Debug without the payload#341
Mliviu79 wants to merge 1 commit into
emiago:mainfrom
Mliviu79:pr/parselog

Conversation

@Mliviu79

@Mliviu79 Mliviu79 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Fixes #340

TCP, UDP and WS logged an unparseable message at Error with the raw bytes:

    t.log.Error("failed to parse", "error", err, "data", string(data))

Both halves are reachable by any host that can reach the listener, pre-auth.

Level. The peer picks when this fires. Unparseable input is the normal
background of an open SIP port (scans, truncated datagrams, non-SIP traffic),
not an application fault. At Error a remote host sets the process error rate at
will and hides real faults behind it. Debug matches the other peer-triggered
events on this path (keep-alive CRLF, peer close); Error stays for local faults
(read and filter errors).

Payload. A REGISTER that fails to parse still carries its Authorization header
(RFC 3261 s20.7), so the digest response reaches the log. Truncation does not
fix it, the credential is within the first few hundred bytes. Dumping only at
Debug does not either, that is the level enabled to chase the peer.

src and len(data) replace it. Which peer, and how much it sent, is what
diagnosing a malformed peer needs; err already names the offending token. The
bytes are a pcap's job.

TLS and WSS inherit both call sites through the TransportTCP and TransportWS
embeds, so all five transports move together.
@emiago

emiago commented Aug 7, 2026

Copy link
Copy Markdown
Owner

I had recent fixes (AI analysis) check is conflict because of this. Again remove comments, we do not need to explain debug lines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sip: parse failures log the raw payload at Error, pre-auth

2 participants