Show
Ignore:
Timestamp:
04/10/06 12:19:35 (4 years ago)
Author:
ahu
Message:

implement very simple SMP support

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/pdns_recursor.cc

    r670 r672  
    389389void makeControlChannelSocket() 
    390390{ 
    391   s_rcc.listen(::arg()["socket-dir"]+"/pdns_recursor.controlsocket"); 
     391  string sockname=::arg()["socket-dir"]+"/pdns_recursor.controlsocket"; 
     392  if(::arg().mustDo("fork")) { 
     393    sockname+="."+lexical_cast<string>(getpid()); 
     394    L<<Logger::Warning<<"Forked control socket name: "<<sockname<<endl; 
     395  } 
     396  s_rcc.listen(sockname); 
    392397} 
    393398 
     
    700705    ::arg().set("allow-from", "If set, only allow these comma separated netmasks to recurse")=""; 
    701706    ::arg().set("max-tcp-per-client", "If set, maximum number of TCP sessions per client (IP address)")="0"; 
     707    ::arg().set("fork", "If set, fork the daemon for possible double performance")="no"; 
    702708 
    703709    ::arg().setCmd("help","Provide a helpful message"); 
     
    750756  } 
    751757 
    752     makeClientSocket(); 
    753758    makeUDPServerSockets(); 
    754759    makeTCPServerSockets(); 
     760 
     761    if(::arg().mustDo("fork")) { 
     762      fork(); 
     763      L<<Logger::Warning<<"This is forked pid "<<getpid()<<endl; 
     764    } 
     765    makeClientSocket(); 
     766 
    755767    makeControlChannelSocket(); 
    756768