mirror of
https://github.com/soypat/lneto.git
synced 2026-09-10 08:39:30 +00:00
heap: remove heap alloc in pcap of HTTP content type; more debugging logs
This commit is contained in:
@@ -241,6 +241,7 @@ func (listener *Listener) Demux(carrierData []byte, tcpFrameOffset int) error {
|
||||
listener.logerr("Listener:demux", slog.String("err", err.Error()))
|
||||
return lneto.ErrPacketDrop
|
||||
}
|
||||
debuglog("tcplistener:demux-append")
|
||||
listener.incoming = append(listener.incoming, handler{
|
||||
conn: conn,
|
||||
id: *conn.ConnectionID(),
|
||||
@@ -316,3 +317,11 @@ func (listener *Listener) returnIncoming(idx int) {
|
||||
listener.poolReturn(listener.incoming[idx].conn)
|
||||
listener.incoming[idx] = handler{}
|
||||
}
|
||||
|
||||
const enableDebug = internal.HeapAllocDebugging
|
||||
|
||||
func debuglog(msg string) {
|
||||
if enableDebug {
|
||||
internal.LogAllocs(msg)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user