Skip to content

Commit

Permalink
reset buffer after use
Browse files Browse the repository at this point in the history
Signed-off-by: Brian Downs <brian.downs@gmail.com>
  • Loading branch information
briandowns committed Oct 22, 2021
1 parent 02a314c commit 1e055c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/cluster/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ RETRY:
}

files := make(bootstrap.PathsDataformat)

if err := json.NewDecoder(buf).Decode(&files); err != nil {
// This will fail if data is being pulled from old an cluster since
// older clusters used a map[string][]byte for the data structure.
Expand All @@ -254,6 +253,7 @@ RETRY:
return err
}
}
buf.Seek(0, 0)

type update struct {
db, disk, conflict bool
Expand Down
3 changes: 2 additions & 1 deletion pkg/cluster/https.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ func (c *Cluster) initClusterAndHTTPS(ctx context.Context) error {

// Create a HTTP server with the registered request handlers, using logrus for logging
server := http.Server{
Handler: handler}
Handler: handler,
}

if logrus.IsLevelEnabled(logrus.DebugLevel) {
server.ErrorLog = log.New(logrus.StandardLogger().Writer(), "Cluster-Http-Server ", log.LstdFlags)
Expand Down

0 comments on commit 1e055c3

Please sign in to comment.