Commit 1afeb7fc authored by Libor Peltan's avatar Libor Peltan

bugfix: serialization sometimes looses rrset

the cause is that if happens that `tmp_phase == SERIALIZE_RRSET_INIT`
but at the same time `candidate > max_size`
we exit the function `serialize_prepare` with SERIALIZE_RRSET_INIT
BUT the rrset has been already loaded to rrset_buf with get_next_rrset
parent a183fac2
......@@ -98,8 +98,7 @@ void serialize_prepare(serialize_ctx_t *ctx, size_t max_size, size_t *realsize)
*realsize = 0;
// check if we are in middle of a rrset
if (ctx->rrset_phase != SERIALIZE_RRSET_INIT) {
assert(ctx->rrset_buf_size > 0);
if (ctx->rrset_buf_size > 0) {
ctx->rrset_buf[0] = ctx->rrset_buf[ctx->rrset_buf_size - 1];
ctx->rrset_buf_size = 1;
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment