t_respond (int j)
{
    if (!t[j].active)
        return;

    if (debug_level)
        log_querydone (&t[j].active, response_len);

    response_id (t[j].id);
    t[j].len = response_len + 2;
    t_free (j);
    t[j].buf = alloc (response_len + 2);
    if (!t[j].buf)
    {
        t_close (j);
        return;
    }
    uint16_pack_big (t[j].buf, response_len);
    byte_copy (t[j].buf + 2, response_len, response);
    t[j].pos = 0;
    t[j].state = -1;
}
t_respond (int j)
{
    if (!t[j].active)
        return;

    if (debug_level)
        log_querydone (&t[j].active, response_len);

    response_id (t[j].id);
    t[j].len = response_len + 2;
    t_free (j);
    t[j].buf = alloc (response_len + 2);
    if (!t[j].buf)
    {
        t_close (j);
        return;
    }
    uint16_pack_big (t[j].buf, response_len);
    byte_copy (t[j].buf + 2, response_len, response);
    t[j].pos = 0;
    t[j].state = -1;
}