content: close stream after commit request

This allows both client and server to determine when
stream is completed. Previously this was done by
closesend call from the client side but that is async
so client can not assume that the server side also
already thinks that stream is complete.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi 2021-10-21 19:24:28 -07:00
parent 9d5c1165a6
commit 010a9e2bca

View File

@ -423,6 +423,10 @@ func (s *service) Write(session api.Content_WriteServer) (err error) {
return err
}
if req.Action == api.WriteActionCommit {
return nil
}
req, err = session.Recv()
if err != nil {
if err == io.EOF {