From 2e594fea3adca27872884caeb8946e5f21d9c412 Mon Sep 17 00:00:00 2001 From: mohanson Date: Wed, 2 Oct 2024 20:54:51 +0800 Subject: [PATCH] 2024-10-02 20:54:51 --- protocol/etch/engine.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 {