Browse Source

[805] Comment updates

Michal 'vorner' Vaner 13 years ago
parent
commit
9d4ae52d55

+ 8 - 1
src/lib/server_common/portconfig.cc

@@ -94,6 +94,11 @@ setAddresses(DNSService& service, const AddressList& addresses) {
     BOOST_FOREACH(const AddressPair &address, addresses) {
         const int af(IOAddress(address.first).getFamily());
         // TODO: Support sharing somehow in future.
+
+        // As for now, we hardcode the application name as dummy_app, because:
+        // * we don't have a name available in our interface, which will change
+        //   soon anyway
+        // * we use the DONT_SHARE mode, so the name is irrelevant anyway
         const SocketRequestor::SocketID
             tcp(socketRequestor().requestSocket(SocketRequestor::TCP,
                                                 address.first, address.second,
@@ -151,7 +156,9 @@ installListenAddresses(const AddressList& newAddresses,
         }
         catch (const exception& e2) {
             LOG_FATAL(logger, SRVCOMM_ADDRESS_UNRECOVERABLE).arg(e2.what());
-            // Releasing them should really work
+            // If we can't set the new ones, nor the old ones, at last
+            // releasing everything should work. If it doesn't, there isn't
+            // anything else we could do.
             AddressList empty;
             setAddresses(service, empty);
             addressStore.clear();

+ 3 - 3
src/lib/server_common/tests/portconfig_unittest.cc

@@ -257,7 +257,7 @@ TEST_F(InstallListenAddresses, rollback) {
                                 "Released after rollback");
 }
 
-// Try it at least returns everything when even the rollback fails.
+// Try it at least releases everything when even the rollback fails.
 TEST_F(InstallListenAddresses, brokenRollback) {
     EXPECT_NO_THROW(installListenAddresses(valid_, store_, dnss_));
     checkAddresses(valid_, "Before rollback");
@@ -268,8 +268,8 @@ TEST_F(InstallListenAddresses, brokenRollback) {
                  SocketRequestor::SocketError);
     // No addresses here
     EXPECT_TRUE(store_.empty());
-    // These should be requested in the first part of the failure to bind
-    // and the second pair in the first part of rollback
+    // The first pair should be requested in the first part of the failure to
+    // bind and the second pair in the first part of rollback
     const char* tokens[] = {
         "TCP:127.0.0.1:5288:5",
         "UDP:127.0.0.1:5288:6",