transport: log parse failures at Debug without the payload - #341
Open
Mliviu79 wants to merge 1 commit into
Open
Conversation
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.
Owner
|
I had recent fixes (AI analysis) check is conflict because of this. Again remove comments, we do not need to explain debug lines |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #340