]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Warn if two services share the same key.
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 8 May 2008 20:34:13 +0000 (14:34 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Thu, 8 May 2008 20:34:13 +0000 (14:34 -0600)
TODO: Do not just warn, quit?

src/adaptation/Config.cc

index aa3ca03691f3e4668c8d6c2c042de82f8c2df9b9..61bbc4c8cca9da6f9d0e4e485d41f3bd2e52b69e 100644 (file)
@@ -81,6 +81,12 @@ Adaptation::Config::finalize()
     const Vector<ServiceConfig*> &configs = serviceConfigs;
     debugs(93,3, "Found " << configs.size() << " service configs.");
     for (VISCI i = configs.begin(); i != configs.end(); ++i) {
+               const ServiceConfig &cfg = **i;
+               if (FindService(cfg.key) != NULL) {
+                       debugs(93,0, "ERROR: Duplicate adaptation service name: " <<
+                cfg.key);
+                       continue; // TODO: make fatal
+               }
         ServicePointer s = createService(**i);
         if (s != NULL)
             AllServices().push_back(s);