int pkt_renew(knot_pkt_t *pkt, const knot_dname_t *name, uint16_t type);
/** Append RRset + its RRSIGs into the current section (*shallow* copy), with given rank.
+ *
* \note it works with empty set as well (skipped)
* \note pkt->wire is not updated in any way
* \note KNOT_CLASS_IN is assumed
+ * \note Whole RRsets are put into the pseudo-packet;
+ * normal parsed packets would only contain single-RR sets.
*/
int pkt_append(knot_pkt_t *pkt, const struct answer_rrset *rrset, uint8_t rank);
int kr_ranked_rrarray_add(ranked_rr_array_t *array, const knot_rrset_t *rr,
uint8_t rank, bool to_wire, uint32_t qry_uid, knot_mm_t *pool)
{
- /* rr always has one record per rrset
- * check if another rrset with the same
+ /* From normal packet parser we always get RRs one by one,
+ * but cache and prefil modules (also) feed us larger RRsets. */
+ (void)!kr_assume(rr->rrs.count >= 1);
+ /* Check if another rrset with the same
* rclass/type/owner combination exists within current query
* and merge if needed */
for (ssize_t i = array->len - 1; i >= 0; --i) {
/* Found the entry to merge with. Check consistency and merge. */
if (!kr_assume(stashed->rank == rank && !stashed->cached && stashed->in_progress))
return kr_error(EEXIST);
- //(void)!kr_assume(rr->rrs.count == 1);
- /* ^^ shouldn't be a problem for this function, but it's probably a bug */
/* It may happen that an RRset is first considered useful
* (to_wire = false, e.g. due to being part of glue),