From: Alex Rousskov Date: Thu, 8 May 2008 20:34:13 +0000 (-0600) Subject: Warn if two services share the same key. X-Git-Tag: SQUID_3_1_0_1~45^2~11^2~26^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e7de5ca3d2aa51590f9283b9481c78a2090b611b;p=thirdparty%2Fsquid.git Warn if two services share the same key. TODO: Do not just warn, quit? --- diff --git a/src/adaptation/Config.cc b/src/adaptation/Config.cc index aa3ca03691..61bbc4c8cc 100644 --- a/src/adaptation/Config.cc +++ b/src/adaptation/Config.cc @@ -81,6 +81,12 @@ Adaptation::Config::finalize() const Vector &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);