summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-05-18 12:34:41 -0500
committerBrent Baude <bbaude@redhat.com>2020-05-18 12:34:41 -0500
commit904ee392f1cdf4368d8554b149415906dbb25ba0 (patch)
tree5bd1b7b51caeb56b78884ec4ccc2f5a88f8ca0e0
parent37a3aa6c83603ec774939a8d07c950dd3b26110a (diff)
downloadpodman-904ee392f1cdf4368d8554b149415906dbb25ba0.tar.gz
podman-904ee392f1cdf4368d8554b149415906dbb25ba0.tar.bz2
podman-904ee392f1cdf4368d8554b149415906dbb25ba0.zip
Fix EOM for SendFile
To terminate a connection of varlink, say after sending a file, we need to send a message containing a delimiter of ':' so the client knows to hang up. Fixes: #6237 Signed-off-by: Brent Baude <bbaude@redhat.com>
-rw-r--r--pkg/varlinkapi/transfers.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/varlinkapi/transfers.go b/pkg/varlinkapi/transfers.go
index 9df8ffcdc..b406f6aed 100644
--- a/pkg/varlinkapi/transfers.go
+++ b/pkg/varlinkapi/transfers.go
@@ -4,6 +4,7 @@ package varlinkapi
import (
"bufio"
+ "fmt"
"io"
"io/ioutil"
"os"
@@ -39,7 +40,7 @@ func (i *VarlinkAPI) SendFile(call iopodman.VarlinkCall, ftype string, length in
logrus.Debugf("successfully received %s", outputFile.Name())
// Send an ACK to the client
- call.Call.Writer.WriteString(outputFile.Name())
+ call.Call.Writer.WriteString(fmt.Sprintf("%s:", outputFile.Name()))
call.Call.Writer.Flush()
return nil