From 19f9117b429322aed7d121fb32e180e2fb034386 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Mon, 16 Feb 2015 12:27:09 +0100 Subject: [PATCH] remove dependency on sendmmsg, which did not help in any case --- pdns/calidns.cc | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/pdns/calidns.cc b/pdns/calidns.cc index 7384ec9b8..4806340c6 100644 --- a/pdns/calidns.cc +++ b/pdns/calidns.cc @@ -109,27 +109,17 @@ void sendThread(const vector* sockets, const vector >* for(const auto& p : *packets) { count++; - unique_ptr u{new Unit()}; + Unit u; - fillMSGHdr(&u->msgh, &u->iov, u->cbuf, 0, (char*)&p[0], p.size(), &dest); - units.emplace_back(std::move(u)); - - if(units.size()==burst) { - vector job; - for(auto& u : units) { - job.push_back({u->msgh, 0}); - } - if((ret=sendmmsg((*sockets)[count % sockets->size()]->getHandle(), - &job[0], job.size(), 0)) != job.size()) { - if(ret < 0) - unixDie("sendmmsg"); - else - cerr<<"Sent out partial number of packets: "<size()]->getHandle(), + &u.msgh, 0))) + if(ret < 0) + unixDie("sendmmsg"); + + + if(!(count%burst)) nanosleep(&nsec, 0); - units.clear(); - - } } } -- 2.40.0