aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/internal/common/server.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-07-25 16:14:32 +0200
committerGitHub <noreply@github.com>2017-07-25 16:14:32 +0200
commitfbf2a4ab4588c78e3d9d0265dba774ae6b388b5f (patch)
tree883e9172499234f9f258fb41190fcd0f9134c0a4 /plumbing/transport/internal/common/server.go
parent25a0420bc0544f826e5517365e986d83bbb926c8 (diff)
parentdb5fa522f36207684ec0d67b98cac6313f0259b6 (diff)
downloadgo-git-fbf2a4ab4588c78e3d9d0265dba774ae6b388b5f.tar.gz
Merge pull request #507 from mcuadros/ctx
transport: context package support allowing cancellation of any network operation
Diffstat (limited to 'plumbing/transport/internal/common/server.go')
-rw-r--r--plumbing/transport/internal/common/server.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/plumbing/transport/internal/common/server.go b/plumbing/transport/internal/common/server.go
index dd6cfbe..f4ca692 100644
--- a/plumbing/transport/internal/common/server.go
+++ b/plumbing/transport/internal/common/server.go
@@ -1,6 +1,7 @@
package common
import (
+ "context"
"fmt"
"io"
@@ -34,7 +35,7 @@ func ServeUploadPack(cmd ServerCommand, s transport.UploadPackSession) (err erro
}
var resp *packp.UploadPackResponse
- resp, err = s.UploadPack(req)
+ resp, err = s.UploadPack(context.TODO(), req)
if err != nil {
return err
}
@@ -57,7 +58,7 @@ func ServeReceivePack(cmd ServerCommand, s transport.ReceivePackSession) error {
return fmt.Errorf("error decoding: %s", err)
}
- rs, err := s.ReceivePack(req)
+ rs, err := s.ReceivePack(context.TODO(), req)
if rs != nil {
if err := rs.Encode(cmd.Stdout); err != nil {
return fmt.Errorf("error in encoding report status %s", err)