forked from TrueCloudLab/frostfs-node
[#13] object/grpc: Fix Put call implementation
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
5caabf4208
commit
d03b153e09
1 changed files with 11 additions and 11 deletions
|
@ -57,12 +57,7 @@ func (s *Server) Put(gStream objectGRPC.ObjectService_PutServer) error {
|
||||||
|
|
||||||
for {
|
for {
|
||||||
req, err := gStream.Recv()
|
req, err := gStream.Recv()
|
||||||
if err == nil {
|
if err != nil {
|
||||||
if err := stream.Send(object.PutRequestFromGRPCMessage(req)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if errors.Is(errors.Cause(err), io.EOF) {
|
if errors.Is(errors.Cause(err), io.EOF) {
|
||||||
resp, err := stream.CloseAndRecv()
|
resp, err := stream.CloseAndRecv()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -74,6 +69,11 @@ func (s *Server) Put(gStream objectGRPC.ObjectService_PutServer) error {
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := stream.Send(object.PutRequestFromGRPCMessage(req)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete converts gRPC DeleteRequest message and passes it to internal Object service.
|
// Delete converts gRPC DeleteRequest message and passes it to internal Object service.
|
||||||
|
|
Loading…
Reference in a new issue