]> granicus.if.org Git - pdns/commitdiff
remove dependency on sendmmsg, which did not help in any case
authorbert hubert <bert.hubert@netherlabs.nl>
Mon, 16 Feb 2015 11:27:09 +0000 (12:27 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Mon, 16 Feb 2015 11:27:27 +0000 (12:27 +0100)
pdns/calidns.cc

index 7384ec9b82690ab75c4f883d3ba927b1861baa6a..4806340c630a489be5a2d3ab40b10901715a46a3 100644 (file)
@@ -109,27 +109,17 @@ void sendThread(const vector<Socket*>* sockets, const vector<vector<uint8_t> >*
   for(const auto& p : *packets) {
     count++;
 
-    unique_ptr<Unit> 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<struct mmsghdr> 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: "<<ret<<endl;
-      }
+    fillMSGHdr(&u.msgh, &u.iov, u.cbuf, 0, (char*)&p[0], p.size(), &dest);
+    if((ret=sendmsg((*sockets)[count % sockets->size()]->getHandle(), 
+                   &u.msgh, 0)))
+      if(ret < 0)
+       unixDie("sendmmsg");
+    
+    
+    if(!(count%burst))
       nanosleep(&nsec, 0);
-      units.clear();
-
-    }
   }
 }