From c98472165b1e6106ea419744ee34afcb9e494946 Mon Sep 17 00:00:00 2001 From: adman Date: Sun, 3 May 2026 15:14:47 +0200 Subject: [PATCH] update connection initialization logic --- proto/connection_test.go | 3 +-- server/server.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/proto/connection_test.go b/proto/connection_test.go index 823f72e..2ae0165 100644 --- a/proto/connection_test.go +++ b/proto/connection_test.go @@ -7,7 +7,6 @@ import ( "github.com/admin-else/strom/proto" "github.com/admin-else/strom/proto_base" - "github.com/admin-else/strom/server" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" ) @@ -24,7 +23,7 @@ func NewStateFuzzer(state proto_base.State, actor proto_base.Actor) func(t *test return func(t *testing.T, inbytes []byte) { b1 := bytes.NewBuffer(inbytes) b2 := bytes.NewBuffer(nil) - conn := server.Servee(nil) + conn := proto.NewConn() conn.SetState(state) conn.Actor = actor conn.R = b1 diff --git a/server/server.go b/server/server.go index c4e2182..fa1a023 100644 --- a/server/server.go +++ b/server/server.go @@ -2,7 +2,6 @@ package server import ( "errors" - "log/slog" "net" "github.com/admin-else/strom/proto" @@ -17,7 +16,7 @@ func Servee(c net.Conn) (ret *proto.Conn) { ret.R = c ret.W = c - ret.Log = slog.Default().With("conn", c.RemoteAddr()) + ret.Log = ret.Log.With("conn", c.RemoteAddr()) return }