diff --git a/protocol/etch/engine.go b/protocol/etch/engine.go index 876f3b8..6050f42 100644 --- a/protocol/etch/engine.go +++ b/protocol/etch/engine.go @@ -8,6 +8,13 @@ import ( "github.com/mohanson/daze/lib/doa" ) +// Conf is acting as package level configuration. +var Conf = struct { + PayloadSize int +}{ + PayloadSize: 508, +} + // Server implemented the etch protocol. type Server struct { Closer io.Closer @@ -36,7 +43,7 @@ func (s *Server) Run() error { log.Println("main: listen and serve on", s.Listen) go func() { - buf := make([]byte, 512) + buf := make([]byte, Conf.PayloadSize) for { n, addr, err := conn.ReadFromUDP(buf) if err != nil {