Changeset 1379

Show
Ignore:
Timestamp:
07/30/09 21:55:18 (4 years ago)
Author:
ahu
Message:

cherry pick for 3.1.7.1:
1260 mtasker waitkey, sockets reusable call

Location:
tags/pdns-3.1.7.1/pdns
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • tags/pdns-3.1.7.1/pdns/misc.hh

    r1094 r1379  
    2323 
    2424#if 0 
    25 #define RDTSC(qp) \ 
    26 do { \ 
    27   unsigned long lowPart, highPart;                                      \ 
    28   __asm__ __volatile__("cpuid"); \ 
    29   __asm__ __volatile__("rdtsc" : "=a" (lowPart), "=d" (highPart)); \ 
    30     qp = (((unsigned long long) highPart) << 32) | lowPart; \ 
    31 } while (0) 
    32  
    3325#include <iostream> 
    3426using std::cout; 
     
    389381} 
    390382 
     383inline void setSocketReusable(int fd) 
     384{ 
     385  int tmp=1; 
     386  setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char*)&tmp, static_cast<unsigned>(sizeof tmp)); 
     387} 
     388 
    391389string stripDot(const string& dom); 
    392390 
  • tags/pdns-3.1.7.1/pdns/mtasker.cc

    r1116 r1379  
    302302      if(i->ttd && (unsigned int)i->ttd < now) { 
    303303        d_waitstatus=TimeOut; 
     304        d_eventkey=i->key;        // pass waitEvent the exact key it was woken for 
    304305        ucontext_t* uc = i->context; 
    305306        ttdindex.erase(i++);                  // removes the waitpoint