From b4afbd54352e1a31bc7511b22c75b59a3a0ff2bd Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Tue, 26 May 2015 17:25:17 +0200 Subject: [PATCH] Shrink ChunkedSigningPipe from 240 to 232 bytes --- pdns/signingpipe.cc | 4 ++-- pdns/signingpipe.hh | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pdns/signingpipe.cc b/pdns/signingpipe.cc index 0240b8edc..e3f4f634d 100644 --- a/pdns/signingpipe.cc +++ b/pdns/signingpipe.cc @@ -71,8 +71,8 @@ catch(...) { } ChunkedSigningPipe::ChunkedSigningPipe(const string& signerName, bool mustSign, const string& servers, unsigned int workers) - : d_queued(0), d_outstanding(0), d_signer(signerName), d_maxchunkrecords(100), d_numworkers(workers), d_tids(d_numworkers), - d_mustSign(mustSign), d_final(false), d_submitted(0) + : d_queued(0), d_outstanding(0), d_numworkers(workers), d_submitted(0), d_signer(signerName), + d_maxchunkrecords(100), d_tids(d_numworkers), d_mustSign(mustSign), d_final(false) { d_rrsetToSign = new rrset_t; d_chunks.push_back(vector()); // load an empty chunk diff --git a/pdns/signingpipe.hh b/pdns/signingpipe.hh index 8cb5a2bf3..b7f906477 100644 --- a/pdns/signingpipe.hh +++ b/pdns/signingpipe.hh @@ -23,8 +23,9 @@ public: ~ChunkedSigningPipe(); bool submit(const DNSResourceRecord& rr); chunk_t getChunk(bool final=false); - int d_queued; + AtomicCounter d_signed; + int d_queued; int d_outstanding; unsigned int getReady(); private: @@ -37,6 +38,10 @@ private: void worker(int n, int fd); static void* helperWorker(void* p); + + unsigned int d_numworkers; + int d_submitted; + rrset_t* d_rrsetToSign; std::deque< std::vector > d_chunks; string d_signer; @@ -45,11 +50,9 @@ private: std::vector d_sockets; std::set d_eof; - unsigned int d_numworkers; vector d_tids; bool d_mustSign; bool d_final; - int d_submitted; }; #endif -- 2.40.0