methodtDoublePirClient.Query
procedure Query(aRecordIndex: Integer; var aQuery: tPirWordArray);
c1 followed by c2, with Delta added to entry aRecordIndex mod ColCount of the first and to entry aRecordIndex div ColCount of the second.
WHEN THE TWO SECRETS AND THE TWO QUERY SUMS GO, EXACTLY. Three calls clear them and nothing else does: Recover once it reaches its decode block, on the way out and on a raise from inside it; the head of the next QueryFrom that gets past its index check, for the previous query's pair, and that same call's failure path for the pair it had just drawn; and the destructor. Checked as 'Recover CLEARS the first secret before it releases it', 'starting a query CLEARS the secrets the last one left', 'and the secrets the failed query had already drawn are cleared and released', and 'a client freed with a query outstanding CLEARS both secrets'.
A REFUSAL IS NOT A CLEARING, AND THIS IS WHERE A SHORTER SENTENCE WOULD BE FALSE. Recover's five entry refusals - no outstanding query, no hint, a hint-version mismatch, a hint-DIGEST mismatch, an answer of the wrong length - raise BEFORE the decode block and deliberately KEEP the pair, because all five leave the client able to try again. So does a Query refused for a record index past the end of the table: that check is the first line of QueryFrom and raises before any state is touched, so the query the client already had still stands and still recovers. That one is run rather than argued: 'a query for an index past the end of the table raises before it touches the state the last query left', 'so THAT refusal keeps both secrets, where a failed draw clears them', and 'and the query it did not replace still recovers its record'.