Changeset 230
- Timestamp:
- 02/04/04 23:41:17 (9 years ago)
- Location:
- trunk/pdns/pdns
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/dnspacket.cc
r198 r230 17 17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 // $Id: dnspacket.cc,v 1.2 3 2003/11/23 15:14:57 ahu Exp $19 // $Id: dnspacket.cc,v 1.24 2004/02/04 22:41:17 ahu Exp $ 20 20 #include "utility.hh" 21 21 #include <cstdio> … … 1241 1241 // SPARC alignment issues. 1242 1242 1243 rr.content+=" ";rr.content+= itoa(getLong( datapos+offset ));1244 rr.content+=" ";rr.content+= itoa(getLong( datapos+offset+4 ));1245 rr.content+=" ";rr.content+= itoa(getLong( datapos+offset+8 ));1246 rr.content+=" ";rr.content+= itoa(getLong( datapos+offset+12 ));1247 rr.content+=" ";rr.content+= itoa(getLong( datapos+offset+16 ));1243 rr.content+=" ";rr.content+=uitoa(getLong( datapos+offset )); 1244 rr.content+=" ";rr.content+=uitoa(getLong( datapos+offset+4 )); 1245 rr.content+=" ";rr.content+=uitoa(getLong( datapos+offset+8 )); 1246 rr.content+=" ";rr.content+=uitoa(getLong( datapos+offset+12 )); 1247 rr.content+=" ";rr.content+=uitoa(getLong( datapos+offset+16 )); 1248 1248 1249 1249 break; -
trunk/pdns/pdns/misc.cc
r222 r230 256 256 } 257 257 258 string uitoa(unsigned int i) // MSVC 6 doesn't grok overloading (un)signed 259 { 260 ostringstream o; 261 o<<i; 262 return o.str(); 263 } 264 265 258 266 string stringerror() 259 267 { -
trunk/pdns/pdns/misc.hh
r222 r230 117 117 string stringerror(); 118 118 string itoa(int i); 119 string uitoa(unsigned int i); 119 120 120 121 void dropPrivs(int uid, int gid); -
trunk/pdns/pdns/qgen.cc
r229 r230 56 56 unsigned int d_maxOutstanding; 57 57 unsigned int d_maxToRead; 58 unsigned int d_timeout; 58 59 unsigned int d_answeredOK; 59 60 unsigned int d_delayed; … … 78 79 void sendQuestion(const string& qname, QType qtype); 79 80 QGen(const string &server, unsigned int port, const string &fileName, 80 unsigned int maxOutstanding, unsigned int maxBurst, unsigned int maxToRead );81 unsigned int maxOutstanding, unsigned int maxBurst, unsigned int maxToRead, unsigned int timeout); 81 82 void start(); 82 83 … … 95 96 unsigned int maxOutstanding, 96 97 unsigned int maxBurst, 97 unsigned int maxToRead) : d_in(fileName.c_str()) 98 unsigned int maxToRead, 99 unsigned int timeout) : d_in(fileName.c_str()) 98 100 { 99 101 d_answeredOK = d_numqueries = d_delayed = d_unmatched = d_servfail = d_nxdomain = 0; … … 105 107 d_maxToRead = maxToRead; 106 108 d_maxBurst=maxBurst; 109 d_timeout=timeout; 107 110 struct in_addr inp; 108 111 Utility::inet_aton(server.c_str(),&inp); … … 133 136 134 137 for(multiset<OutstandingQuestion>::iterator i=d_questions.begin();i!=d_questions.end();) 135 if(now-i->timeSent > 5) {136 c out<<"No answer received to question for "<<i->qname<<endl;137 cout<<i->qname<<" "<<i->qtype.getName()<<" NO ANSWER"<<endl;138 if(now-i->timeSent > d_timeout) { 139 cerr<<"No answer received to question for "<<i->qname<<endl; 140 cout<<i->qname<<" "<<i->qtype.getName()<<" NO ANSWER"<<endl; 138 141 d_unanswered.insert(*i); 139 142 d_questions.erase(i++); … … 318 321 at.add("max-outstanding",Numeric(),"200"); 319 322 at.add("max-questions",Numeric(),"0"); 323 at.add("timeout",Numeric(),"30"); 320 324 at.parse(argc, argv); 321 325 cout<<"hier 1"<<endl; … … 329 333 unsigned int maxOutstanding=at.getInt("max-outstanding"); 330 334 unsigned int maxToRead=at.getInt("max-questions"); 335 unsigned int timeout=at.getInt("timeout"); 331 336 332 337 // parse commandline here 333 338 334 QGen qg(server, port, fileName, maxOutstanding, maxBurst, maxToRead );339 QGen qg(server, port, fileName, maxOutstanding, maxBurst, maxToRead, timeout); 335 340 qg.start(); 336 341