Changeset 54302 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Feb 19, 2015 4:53:56 PM (10 years ago)
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/HostDnsService.cpp
r53123 r54302 5 5 6 6 /* 7 * Copyright (C) 2013-201 4Oracle Corporation7 * Copyright (C) 2013-2015 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 66 66 } 67 67 68 /* HostDnsInformation */ 69 70 bool HostDnsInformation::equals(const HostDnsInformation &info) const 71 { 72 return (servers == info.servers) 73 && (domain == info.domain) 74 && (searchList == info.searchList); 75 } 76 68 77 inline static void detachVectorOfString(const std::vector<std::string>& v, 69 78 std::vector<com::Utf8Str> &aArray) … … 77 86 struct HostDnsMonitor::Data 78 87 { 79 Data(bool aThreaded):fThreaded(aThreaded){} 88 Data(bool aThreaded) : 89 fInfoModified(false), 90 fThreaded(aThreaded) 91 {} 80 92 81 93 std::vector<PCHostDnsMonitorProxy> proxies; 82 94 HostDnsInformation info; 95 bool fInfoModified; 83 96 const bool fThreaded; 84 97 RTTHREAD hMonitoringThread; … … 188 201 { 189 202 ALock l(this); 190 std::vector<PCHostDnsMonitorProxy>::const_iterator it; 191 for (it = m->proxies.begin(); it != m->proxies.end(); ++it) 192 (*it)->notify(); 203 if (m->fInfoModified) 204 { 205 m->fInfoModified = false; 206 std::vector<PCHostDnsMonitorProxy>::const_iterator it; 207 for (it = m->proxies.begin(); it != m->proxies.end(); ++it) 208 (*it)->notify(); 209 } 193 210 } 194 211 … … 196 213 { 197 214 ALock l(this); 198 m->info = info; 215 // Check for actual modifications, as the Windows specific code seems to 216 // often set the same information as before, without any change to the 217 // previous state. Here we have the previous state, so make sure we don't 218 // ever tell our clients about unchanged info. 219 if (info.equals(m->info)) 220 { 221 m->info = info; 222 m->fInfoModified = true; 223 } 199 224 } 200 225 -
trunk/src/VBox/Main/src-server/HostDnsService.h
r53165 r54302 60 60 std::string domain; 61 61 std::vector<std::string> searchList; 62 bool equals(const HostDnsInformation &) const; 62 63 }; 63 64
Note:
See TracChangeset
for help on using the changeset viewer.