update connection initialization logic

This commit is contained in:
adman
2026-05-03 15:14:47 +02:00
parent 4888a07ebb
commit c98472165b
2 changed files with 2 additions and 4 deletions
+1 -2
View File
@@ -7,7 +7,6 @@ import (
"github.com/admin-else/strom/proto" "github.com/admin-else/strom/proto"
"github.com/admin-else/strom/proto_base" "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"
"github.com/google/go-cmp/cmp/cmpopts" "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) { return func(t *testing.T, inbytes []byte) {
b1 := bytes.NewBuffer(inbytes) b1 := bytes.NewBuffer(inbytes)
b2 := bytes.NewBuffer(nil) b2 := bytes.NewBuffer(nil)
conn := server.Servee(nil) conn := proto.NewConn()
conn.SetState(state) conn.SetState(state)
conn.Actor = actor conn.Actor = actor
conn.R = b1 conn.R = b1
+1 -2
View File
@@ -2,7 +2,6 @@ package server
import ( import (
"errors" "errors"
"log/slog"
"net" "net"
"github.com/admin-else/strom/proto" "github.com/admin-else/strom/proto"
@@ -17,7 +16,7 @@ func Servee(c net.Conn) (ret *proto.Conn) {
ret.R = c ret.R = c
ret.W = c ret.W = c
ret.Log = slog.Default().With("conn", c.RemoteAddr()) ret.Log = ret.Log.With("conn", c.RemoteAddr())
return return
} }