21227: Fix copied mutexes.
[arvados.git] / services / keepstore / proxy_remote.go
index 171dee3c4bb1c5ed15c21885599f0452251cbabc..66a7b43751628ea5e50a90994fe86805c55f498f 100644 (file)
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-package main
+package keepstore
 
 import (
        "context"
@@ -130,14 +130,14 @@ func (rp *remoteProxy) remoteClient(remoteID string, remoteCluster arvados.Remot
        }
        accopy := *kc.Arvados
        accopy.ApiToken = token
-       kccopy := *kc
+       kccopy := kc.Clone()
        kccopy.Arvados = &accopy
        token, err := auth.SaltToken(token, remoteID)
        if err != nil {
                return nil, err
        }
        kccopy.Arvados.ApiToken = token
-       return &kccopy, nil
+       return kccopy, nil
 }
 
 var localOrRemoteSignature = regexp.MustCompile(`\+[AR][^\+]*`)
@@ -177,7 +177,7 @@ func (rrc *remoteResponseCacher) Close() error {
                rrc.ResponseWriter.Write(rrc.Buffer)
                return nil
        }
-       _, err := PutBlock(rrc.Context, rrc.VolumeManager, rrc.Buffer, rrc.Locator[:32])
+       _, err := PutBlock(rrc.Context, rrc.VolumeManager, rrc.Buffer, rrc.Locator[:32], nil)
        if rrc.Context.Err() != nil {
                // If caller hung up, log that instead of subsequent/misleading errors.
                http.Error(rrc.ResponseWriter, rrc.Context.Err().Error(), http.StatusGatewayTimeout)