VirtualBox

Ignore:
Timestamp:
Oct 22, 2013 6:56:03 PM (11 years ago)
Author:
vboxsync
Message:

Main/HostDnsService: splits HostDnsService on "singleton" HostDnsMonitor
which monitors host changes and share DnsInformation to per HostImpl/VirtualBoxImpl objects
HostDnsMonitorProxy.

TODO: Win/Darwin parts might burn (not tested)
TODO: find good place to call HostDnsMonitor::shutdown() to stop
monitoring thread. (ref counting could be used on
HostDnsMonitor::addMonitorProxy and HostDnsMonitor::releaseMonitorProxy,
but it better to pausing monitoring on no --auto-shutdown launches of VBoxSVC).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/win/HostDnsServiceWin.cpp

    r48955 r49235  
    3030
    3131
    32 HRESULT HostDnsServiceWin::init(const VirtualBox *aParent)
     32HRESULT HostDnsServiceWin::init()
    3333{
    34     HRESULT hrc;
    35     hrc = HostDnsService::init(aParent);
     34    HRESULT hrc = HostDnsMonitor::init(aParent);
    3635    AssertComRCReturn(hrc, hrc);
    3736
     
    4039
    4140    return S_OK;
    42 }
    43 
    44 
    45 HRESULT HostDnsServiceWin::start(void)
    46 {
    47     return S_OK;
    48 }
    49 
    50 
    51 void HostDnsServiceWin::stop(void)
    52 {
    5341}
    5442
     
    6149    BYTE abNameServers[256];
    6250    BYTE abSearchList[256];
    63 
    64     m_llNameServers.clear();
    65     m_llSearchStrings.clear();
    66     m_DomainName.setNull();
    67 
    68     RT_ZERO(abDomain);
    69     RT_ZERO(abNameServers);
    70     RT_ZERO(abSearchList);
    7151
    7252    regIndex = 0;
     
    11595    /* OK, now parse and update DNS structures. */
    11696    /* domain name */
    117     m_DomainName = com::Utf8Str((char *)abDomain);
     97    HostDnsInformation info;
     98    info.domain = static_cast<char*>(abDomain);
     99
    118100    /* server list */
    119     strList2List(m_llNameServers, (char *)abNameServers);
     101    strList2List(info.servers, static_cast<char *>(abNameServers));
    120102    /* search list */
    121     strList2List(m_llSearchStrings, (char *)abNameServers);
     103    strList2List(info.searchList, static_cast<char *>(abSearchList));
     104
     105    setInfo(info);
    122106
    123107    return S_OK;
     
    126110
    127111
    128 void HostDnsServiceWin::strList2List(Utf8StrList& lst, char *strLst)
     112void HostDnsServiceWin::strList2List(std::vector<std::string>& lst, char *strLst)
    129113{
    130114    char *next, *current;
     
    146130          strcpy(address, current);
    147131
    148         lst.push_back(com::Utf8Str(address));
     132        lst.push_back(std::string(address));
    149133
    150134        current = next + 1;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette