mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 12:28:42 +00:00
Query::isSatisfiedBy() considers an unfiltered answer sufficient for a filtered query, which is true for a vanilla get: onGetValuesDone() applies the operation filter to the values before calling back. A projected query is different. It receives the fields another query selected and can no longer evaluate its own filters on them, all the more so as those filters may target fields that were not selected at all. Two concurrent queries such as "SELECT id" and "SELECT id WHERE value_type=1" therefore made the filtered callback report identifiers whose type does not match, and searchNodeGetDone() additionally cancelled its own request so it never got a correctly filtered answer. Add Query::isProjectionSatisfiedBy(), which additionally requires both queries to apply the same filters, and use it for operations with a query callback. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>