mirror of
https://github.com/soypat/lneto.git
synced 2026-08-07 08:23:42 +00:00
157a8537a2
* testing.B.Loop() standardization and StackAsync.Debug heap debugging improvement * apply @MDr164 fixes * @MDr164 great suggestions to prevent panic and print correct mallocs
25 lines
344 B
Go
25 lines
344 B
Go
//go:build xnetdebug
|
|
|
|
package xnet
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/soypat/lneto/internal"
|
|
)
|
|
|
|
var _pcap CapturePrinter
|
|
|
|
func init() {
|
|
_pcap.Configure(os.Stdout, CapturePrinterConfig{
|
|
NamespaceWidth: 3,
|
|
})
|
|
}
|
|
|
|
func debugPacket(msg string, b []byte) {
|
|
_pcap.PrintEthernet(msg, b)
|
|
if internal.HeapAllocDebugging {
|
|
internal.LogAllocs(msg)
|
|
}
|
|
}
|