Skip to content

Commit

Permalink
fix: conc map writes in Server.writeParameters
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudbriche authored and jeroenrinzema committed Jan 18, 2024
1 parent f4fcef6 commit cca8e41
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions handshake.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"crypto/tls"
"errors"
"log/slog"
"maps"
"net"

"github.com/jeroenrinzema/psql-wire/pkg/buffer"
Expand Down Expand Up @@ -104,6 +105,8 @@ func (srv *Server) readClientParameters(ctx context.Context, reader *buffer.Read
func (srv *Server) writeParameters(ctx context.Context, writer *buffer.Writer, params Parameters) (_ context.Context, err error) {
if params == nil {
params = make(Parameters, 4)
} else {
params = maps.Clone(params)
}

srv.logger.Debug("writing server parameters")
Expand Down

0 comments on commit cca8e41

Please sign in to comment.