feat(main): add error logging for HTTP parsing failures
Added warning logs when HTTP/1.x request/response parsing fails to aid in debugging malformed traffic and parser issues. Changes: - Log warning when ParseHTTP1Response returns nil - Log warning when ParseHTTP1Request returns nil (SSL events) - Log warning when ParseHTTP1Request returns nil (plain HTTP) Includes src IP and data length for context. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@ -733,6 +733,7 @@ func consumeSSLEvents(ctx context.Context, rd *perf.Reader, mgr *correlation.Man
|
|||||||
if parser.IsHTTP1Response(sslData) {
|
if parser.IsHTTP1Response(sslData) {
|
||||||
resp := parser.ParseHTTP1Response(sslData)
|
resp := parser.ParseHTTP1Response(sslData)
|
||||||
if resp == nil {
|
if resp == nil {
|
||||||
|
log.Printf("[warn] HTTP/1.x response parsing failed for src=%v", key)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
mgr.Update(key, func(s *correlation.SessionState) {
|
mgr.Update(key, func(s *correlation.SessionState) {
|
||||||
@ -868,6 +869,7 @@ func consumeSSLEvents(ctx context.Context, rd *perf.Reader, mgr *correlation.Man
|
|||||||
// HTTP/1.x : parser la requête
|
// HTTP/1.x : parser la requête
|
||||||
req := parser.ParseHTTP1Request(sslData)
|
req := parser.ParseHTTP1Request(sslData)
|
||||||
if req == nil {
|
if req == nil {
|
||||||
|
log.Printf("[warn] HTTP/1.x request parsing failed, src=%v, data_len=%d", key, len(sslData))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
mgr.Update(key, func(s *correlation.SessionState) {
|
mgr.Update(key, func(s *correlation.SessionState) {
|
||||||
@ -1028,6 +1030,7 @@ func consumeHTTPPlainEvents(ctx context.Context, rd *perf.Reader, mgr *correlati
|
|||||||
if parser.IsHTTP1Request(httpData) {
|
if parser.IsHTTP1Request(httpData) {
|
||||||
req := parser.ParseHTTP1Request(httpData)
|
req := parser.ParseHTTP1Request(httpData)
|
||||||
if req == nil {
|
if req == nil {
|
||||||
|
log.Printf("[warn] HTTP plain request parsing failed, src=%v, data_len=%d", key, len(httpData))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
mgr.Update(key, func(s *correlation.SessionState) {
|
mgr.Update(key, func(s *correlation.SessionState) {
|
||||||
|
|||||||
Reference in New Issue
Block a user