Skip to content

Commit

Permalink
Fix EOM for SendFile
Browse files Browse the repository at this point in the history
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: containers#6237

Signed-off-by: Brent Baude <bbaude@redhat.com>
  • Loading branch information
baude committed May 18, 2020
1 parent 37a3aa6 commit 904ee39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/varlinkapi/transfers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package varlinkapi

import (
"bufio"
"fmt"
"io"
"io/ioutil"
"os"
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 904ee39

Please sign in to comment.