Enforce MaxPaths in SCIOND
Fixes
@@ -369,7 +369,15 @@ func (f *fetcherHandler) buildPathsFromDB(ctx context.Context,
}
}
paths := buildPathsToAllDsts(req, ups, cores, downs)
- return f.filterRevokedPaths(ctx, paths)
+ filteredPaths, err := f.filterRevokedPaths(ctx, paths)
+ if err != nil {
+ return nil, err
+ }
+ numpaths := len(filteredPaths)
+ if int(req.MaxPaths) < numpaths {
+ numpaths = int(req.MaxPaths)
+ }
+ return filteredPaths[0:numpaths], nil
}
func (f *Fetcher) getSegmentsFromDB(ctx context.Context, startsAt,
