From: bert hubert Date: Mon, 16 Feb 2015 11:27:09 +0000 (+0100) Subject: remove dependency on sendmmsg, which did not help in any case X-Git-Tag: dnsdist-1.0.0-alpha1~296 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=19f9117b429322aed7d121fb32e180e2fb034386;p=pdns remove dependency on sendmmsg, which did not help in any case --- 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(); - - } } }