forked from TrueCloudLab/frostfs-node
[#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:
parent
6830d54a3c
commit
0b0c61f4a5
1 changed files with 5 additions and 1 deletions
|
@ -154,7 +154,7 @@ func (s *searchStreamMsgSizeCtrl) Send(resp *object.SearchResponse) error {
|
|||
|
||||
var newResp *object.SearchResponse
|
||||
|
||||
for ln := uint64(len(ids)); len(ids) > 0; {
|
||||
for ln := uint64(len(ids)); ; {
|
||||
if newResp == nil {
|
||||
newResp = new(object.SearchResponse)
|
||||
newResp.SetBody(body)
|
||||
|
@ -174,6 +174,10 @@ func (s *searchStreamMsgSizeCtrl) Send(resp *object.SearchResponse) error {
|
|||
}
|
||||
|
||||
ids = ids[cut:]
|
||||
|
||||
if len(ids) == 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue