Changeset 234
- Timestamp:
- 02/08/04 11:43:50 (9 years ago)
- Location:
- trunk/pdns/pdns
- Files:
-
- 8 modified
-
common_startup.cc (modified) (2 diffs)
-
docs/pdns.sgml (modified) (2 diffs)
-
dynlistener.cc (modified) (4 diffs)
-
dynlistener.hh (modified) (3 diffs)
-
mtasker.cc (modified) (1 diff)
-
mtasker.hh (modified) (1 diff)
-
packethandler.cc (modified) (2 diffs)
-
pdns_recursor.cc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/common_startup.cc
r217 r234 58 58 arg().setCmd("no-config","Don't parse configuration file"); 59 59 60 arg().set("version-string","PowerDNS version in packets - full, anonymous, powerdns or custom")="full"; 60 61 arg().set("control-console","Debugging switch - don't use")="no"; // but I know you will! 61 62 arg().set("fancy-records","Process URL and MBOXFW records")="no"; … … 238 239 newuid=Utility::makeUidNumeric(arg()["setuid"]); 239 240 #ifndef WIN32 241 gethostbyname("a.root-servers.net"); // this forces all lookup libraries to be loaded 240 242 if(!arg()["chroot"].empty()) { 241 243 if(chroot(arg()["chroot"].c_str())<0) { -
trunk/pdns/pdns/docs/pdns.sgml
r228 r234 12 12 </author> 13 13 14 <PubDate>v2.1 $Date: 2004/02/0 1 18:20:16$</PubDate>14 <PubDate>v2.1 $Date: 2004/02/08 10:43:50 $</PubDate> 15 15 16 16 <Abstract> … … 5440 5440 Where we send hosts to that need to be url redirected. See <xref linkend="fancy-records">. 5441 5441 </para></listitem></varlistentry> 5442 <varlistentry><term>version-string=anonymous|powerdns|full|custom</term> 5443 <listitem><para> 5444 When queried for its version over DNS (<command>dig chaos txt version.bind @pdns.ip.address</command>), PowerDNS normally 5445 resonds truthfully. With this setting you can overrule what will be returned. Set the <command>version-string</command> 5446 to 'full' to get the default behaviour, to 'powerdns' to just make it state 'served by PowerDNS - http://www.powerdns.com'. 5447 The 'anonymous' setting will return a ServFail, much like Microsoft nameservers do. You can set this response 5448 to a custom value as well. 5449 </para></listitem></varlistentry> 5450 5442 5451 <varlistentry><term>webserver | --webserver=yes | --webserver=no</term> 5443 5452 <listitem><para> -
trunk/pdns/pdns/dynlistener.cc
r228 r234 17 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 // $Id: dynlistener.cc,v 1. 9 2004/02/01 18:20:16ahu Exp $19 // $Id: dynlistener.cc,v 1.10 2004/02/08 10:43:50 ahu Exp $ 20 20 /* (C) Copyright 2002 PowerDNS.COM BV */ 21 21 #include <cstring> … … 53 53 extern StatBag S; 54 54 55 DynListener::~DynListener() 56 { 57 if(!d_socketname.empty()) 58 unlink(d_socketname.c_str()); 59 } 60 55 61 DynListener::DynListener(const string &pname) 56 62 { 57 63 d_restfunc=0; 58 string programname =pname;64 string programname(pname); 59 65 60 66 if(!programname.empty()) { … … 82 88 83 89 socketname+=programname+".controlsocket"; 84 unlink(socketname.c_str()); 90 int err=unlink(socketname.c_str()); 91 if(err < 0 && errno!=ENOENT) { 92 L<<Logger::Critical<<"Unable to remove (previous) controlsocket: "<<strerror(errno)<<endl; 93 exit(1); 94 } 85 95 memset(&local,0,sizeof(local)); 86 96 local.sun_family=AF_UNIX; … … 91 101 exit(1); 92 102 } 93 103 d_socketname=socketname; 94 104 if(!arg()["setgid"].empty()) { 95 105 if(chown(socketname.c_str(),static_cast<uid_t>(-1),Utility::makeGidNumeric(arg()["setgid"]))<0) -
trunk/pdns/pdns/dynlistener.hh
r87 r234 43 43 public: 44 44 DynListener(const string &pname=""); 45 ~DynListener(); 45 46 void go(); 46 47 void theListener(); … … 53 54 void registerRestFunc(g_funk_t *gf); 54 55 private: 56 DynListener(const DynListener &); 57 DynListener& operator=(const DynListener &); 55 58 void sendLine(const string &line); 56 59 string getLine(); … … 70 73 pid_t d_ppid; 71 74 72 75 string d_socketname; 73 76 g_funkdb_t d_funcdb; 74 77 g_funk_t* d_restfunc; -
trunk/pdns/pdns/mtasker.cc
r228 r234 284 284 } 285 285 286 //! returns the number of processes running 287 /** Call this to perhaps limit activities if too many threads are running 288 \return number of processes running 289 */ 290 template<class Key, class Val>unsigned int MTasker<Key,Val>::numProcesses() 291 { 292 return d_threads.size(); 293 } 294 295 286 296 //! gives access to the list of Events threads are waiting for 287 297 /** The kernel can call this to get a list of Events threads are waiting for. This is very useful -
trunk/pdns/pdns/mtasker.hh
r141 r234 80 80 bool schedule(); 81 81 bool noProcesses(); 82 unsigned int numProcesses(); 82 83 int getTid(); 83 84 private: -
trunk/pdns/pdns/packethandler.cc
r228 r234 155 155 156 156 if (p->qclass == 3 && p->qtype.getName() == "HINFO") { 157 rr.content = "PowerDNS $Id: packethandler.cc,v 1.2 3 2004/02/01 18:20:16ahu Exp $";157 rr.content = "PowerDNS $Id: packethandler.cc,v 1.24 2004/02/08 10:43:50 ahu Exp $"; 158 158 rr.ttl = 5; 159 159 rr.qname=target; … … 170 170 { 171 171 DNSResourceRecord rr; 172 173 // modes: anonymous, powerdns only, full, spoofed 174 const string mode=arg()["version-string"]; 172 175 if(p->qtype.getCode()==QType::TXT && target=="version.bind") {// TXT 173 rr.content="Served by POWERDNS "VERSION" $Id: packethandler.cc,v 1.23 2004/02/01 18:20:16 ahu Exp $"; 176 if(mode.empty() || mode=="full") 177 rr.content="Served by POWERDNS "VERSION" $Id: packethandler.cc,v 1.24 2004/02/08 10:43:50 ahu Exp $"; 178 else if(mode=="anonymous") { 179 r->setRcode(RCode::ServFail); 180 return 1; 181 } 182 else if(mode=="powerdns") 183 rr.content="Served by PowerDNS - http://www.powerdns.com"; 184 else 185 rr.content=mode; 186 174 187 rr.ttl=5; 175 188 rr.qname=target; -
trunk/pdns/pdns/pdns_recursor.cc
r232 r234 338 338 L<<Logger::Error<<", "<<(int)(SyncRes::s_throttledqueries*100.0/(SyncRes::s_outqueries+SyncRes::s_throttledqueries))<<"% throttled, " 339 339 <<SyncRes::s_nodelegated<<" no-delegation drops"<<endl; 340 L<<Logger::Error<<"queries running: "<<MT->numProcesses()<<endl; 340 341 341 342 }