Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions pkg/rpc/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,12 @@ import (
)

var (
DefaultTransport http3.Transport
DefaultQUICConfig quic.Config

DefaultLogLevel = slog.LevelInfo
)

func init() {
DefaultTransport.EnableDatagrams = true
DefaultTransport.Logger = slog.Default()
DefaultTransport.TLSClientConfig = &tls.Config{
InsecureSkipVerify: true,
}

DefaultQUICConfig = quic.Config{
// Pin the QUIC Initial at the 1200-byte spec minimum so the handshake
// fits a 1280-MTU path (Tailscale/WireGuard tunnels, the IPv6 minimum).
Expand All @@ -60,8 +53,6 @@ func init() {
InitialConnectionReceiveWindow: 10 * 1024 * 1024, // 10MB total
MaxConnectionReceiveWindow: 20 * 1024 * 1024, // 20MB total max
}

DefaultTransport.QUICConfig = &DefaultQUICConfig
}

// closedPacketConn is a stub net.PacketConn that returns net.ErrClosed on all operations.
Expand Down
6 changes: 4 additions & 2 deletions servers/entityserver/entityserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,12 +677,14 @@ func (e *EntityServer) MakeAttr(ctx context.Context, req *entityserver_v1alpha.E
value = entity.StringValue(args.Value())

case entity.TypeInt:
i, err := strconv.ParseInt(args.Value(), 10, 64)
// Atoi parses at the platform's int width, so out-of-range values are
// rejected rather than silently truncated on 32-bit builds.
i, err := strconv.Atoi(args.Value())
if err != nil {
return fmt.Errorf("invalid integer value: %w", err)
}

value = entity.IntValue(int(i))
value = entity.IntValue(i)

case entity.TypeFloat:
f, err := strconv.ParseFloat(args.Value(), 64)
Expand Down
Loading