heap: remove heap alloc in pcap of HTTP content type; more debugging logs

This commit is contained in:
Patricio Whittingslow
2026-02-28 17:46:08 -03:00
parent 4f7635b216
commit f6e7801d8c
5 changed files with 40 additions and 26 deletions
+2 -1
View File
@@ -70,6 +70,7 @@ func (sb *StackIP) SetLogger(logger *slog.Logger) {
}
func (sb *StackIP) Demux(carrierData []byte, offset int) error {
debugLog("ip:demux")
sb.handlers.info("StackIP.Demux:start")
frame := carrierData[offset:] // we don't care about carrier data in IP.
ifrm, err := ipv4.NewFrame(frame)
@@ -232,7 +233,7 @@ func (l logger) trace(msg string, attrs ...slog.Attr) {
internal.LogAttrs(l.log, internal.LevelTrace, msg, attrs...)
}
const enableAllocLog = false
const enableAllocLog = internal.HeapAllocDebugging
func debugLog(msg string) {
if enableAllocLog {