Hi,
I'm looking at knot-1.6.1 after have experienced failure with sending
AXFR after a zone grew due to enabling DNSSEC, adding a lot of records.
I don't know much about iovecs, but isn't this a short write?
--8<---------------cut here---------------start------------->8---
libknot/internal/errcode.h:
enum knot_error {
...
        KNOT_ECONNREFUSED  = -ECONNREFUSED,
...
        KNOT_ERROR_MIN = -1000,
...
        KNOT_ERROR = KNOT_ERROR_MIN,
...
        KNOT_ECONN,
...
};
libknot/internal/net.c:
int tcp_send_msg(int fd, const uint8_t *msg, size_t msglen)
{
...
        int total_len = iov[0].iov_len + iov[1].iov_len;
        int sent = writev(fd, iov, 2);
        if (sent != total_len) {
                return KNOT_ECONN;
        }
...
}
knot/server/tcp-handler.c:
tcp_handle()
{
...
        while (state & (NS_PROC_FULL|NS_PROC_FAIL)) {
                uint16_t tx_len = tx->iov_len;
                state = knot_process_out(tx->iov_base, &tx_len,
&tcp->query_ctx);
                /* If it has response, send it. */
                if (tx_len > 0) {
                        if (tcp_send_msg(fd, tx->iov_base, tx_len) != tx_len) {
                                ret = KNOT_ECONNREFUSED;
                                break;
                        }
                }
        }
...
}
--8<---------------cut here---------------end--------------->8---
Happy to file a bug report if that's a more proper way of reporting
bugs.