From 74445a0017bb214d34d08971b5d47bf74de7eb38 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Wed, 8 Aug 2018 13:12:50 +0200 Subject: [PATCH] fixup --- cmd/config_job_pull.go | 2 -- cmd/config_job_source.go | 2 +- cmd/replication.go | 3 +-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/cmd/config_job_pull.go b/cmd/config_job_pull.go index 5b4c112..ab65c5b 100644 --- a/cmd/config_job_pull.go +++ b/cmd/config_job_pull.go @@ -10,8 +10,6 @@ import ( "github.com/zrepl/zrepl/util" "github.com/zrepl/zrepl/cmd/replication" "github.com/problame/go-streamrpc" - "io" - "net" ) type PullJob struct { diff --git a/cmd/config_job_source.go b/cmd/config_job_source.go index d212fa5..ef6e991 100644 --- a/cmd/config_job_source.go +++ b/cmd/config_job_source.go @@ -219,7 +219,7 @@ func (j *SourceJob) handleConnection(conn net.Conn, task *Task) { // rpcServer.SetLogger(rpclog, true) //} - if err := streamrpc.ServeConn(rwc, STREAMRPC_CONFIG, handler.Handle); err != nil { + if err := streamrpc.ServeConn(context.TODO(), conn, STREAMRPC_CONFIG, handler.Handle); err != nil { task.Log().WithError(err).Error("error serving connection") } else { task.Log().Info("client closed connection") diff --git a/cmd/replication.go b/cmd/replication.go index d333056..d5ce665 100644 --- a/cmd/replication.go +++ b/cmd/replication.go @@ -325,9 +325,8 @@ type HandlerAdaptor struct { log Logger } -func (a *HandlerAdaptor) Handle(endpoint string, reqStructured *bytes.Buffer, reqStream io.ReadCloser) (resStructured *bytes.Buffer, resStream io.ReadCloser, err error) { +func (a *HandlerAdaptor) Handle(ctx context.Context, endpoint string, reqStructured *bytes.Buffer, reqStream io.ReadCloser) (resStructured *bytes.Buffer, resStream io.ReadCloser, err error) { - ctx := context.Background() if a.log != nil { // FIXME validate type conversion here? ctx = context.WithValue(ctx, streamrpc.ContextKeyLogger, a.log)