[#1063] node/object: Do not skip empty search responses in splitter

In previous implementation `Search` method of transport splitter skipped
responses with empty ID list.

Replace while-loop with do-while one in `TransportSplitter.Search`
method implementation in order to send responses with empty result too.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-01-10 12:19:08 +03:00 committed by Alex Vanin
parent 6830d54a3c
commit 0b0c61f4a5

View file

@ -154,7 +154,7 @@ func (s *searchStreamMsgSizeCtrl) Send(resp *object.SearchResponse) error {
var newResp *object.SearchResponse var newResp *object.SearchResponse
for ln := uint64(len(ids)); len(ids) > 0; { for ln := uint64(len(ids)); ; {
if newResp == nil { if newResp == nil {
newResp = new(object.SearchResponse) newResp = new(object.SearchResponse)
newResp.SetBody(body) newResp.SetBody(body)
@ -174,6 +174,10 @@ func (s *searchStreamMsgSizeCtrl) Send(resp *object.SearchResponse) error {
} }
ids = ids[cut:] ids = ids[cut:]
if len(ids) == 0 {
break
}
} }
return nil return nil