]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Intending
authorRuben d'Arco <cyclops@prof-x.net>
Mon, 22 Jul 2013 19:31:51 +0000 (21:31 +0200)
committerRuben d'Arco <cyclops@prof-x.net>
Mon, 22 Jul 2013 19:46:29 +0000 (21:46 +0200)
pdns/arguments.cc
pdns/dynlistener.cc

index 846b27d6cd0e584aa10f7eec1905f8d5879be499..bbad995e53c8edd274da4105234fc8163c9b1a80 100644 (file)
@@ -146,25 +146,22 @@ string ArgvMap::configstring(bool current)
   else
     help="# Autogenerated configuration file template\n";
   
-  for(map<string,string>::const_iterator i=helpmap.begin();
-      i!=helpmap.end();
-      i++)
-    {
-      if(d_typeMap[i->first]=="Command")
-        continue;
+  for(map<string,string>::const_iterator i=helpmap.begin(); i!=helpmap.end(); i++) {
+    if(d_typeMap[i->first]=="Command")
+      continue;
 
-      help+="#################################\n";
-      help+="# ";
-      help+=i->first;
-      help+="\t";
-      help+=i->second;
-      help+="\n#\n";
-      if (current) {
-        help+=i->first+"="+params[i->first]+"\n\n";
-      } else {
-        help+="# "+i->first+"="+params[i->first]+"\n\n";
-      }
+    help+="#################################\n";
+    help+="# ";
+    help+=i->first;
+    help+="\t";
+    help+=i->second;
+    help+="\n#\n";
+    if (current) {
+      help+=i->first+"="+params[i->first]+"\n\n";
+    } else {
+      help+="# "+i->first+"="+params[i->first]+"\n\n";
     }
+  }
   return help;
 }
 
index 51586640a4c93cac9f948a29a671d77081aaab34..d70e5d724d6a9a3b396456103fe140268560bccb 100644 (file)
@@ -246,7 +246,7 @@ string DynListener::getLine()
       errno=0;
       if(!fgets(&mesg[0], mesg.size(), fp.get())) {
         if(errno)
-         L<<Logger::Error<<"Unable to receive line from controlsocket ("<<d_client<<"): "<<strerror(errno)<<endl;
+          L<<Logger::Error<<"Unable to receive line from controlsocket ("<<d_client<<"): "<<strerror(errno)<<endl;
         close(d_client);
         continue;
       }
@@ -268,9 +268,9 @@ string DynListener::getLine()
     else if(len==0)
       throw PDNSException("Guardian exited - going down as well");
 
-    if(len == (int)mesg.size()) {
+    if(len == (int)mesg.size())
       throw PDNSException("Line on control console was too long");
-    }
+
     mesg[len]=0;
   }
   
@@ -292,8 +292,7 @@ void DynListener::sendlines(const string &l)
       sent+=ret;
     }
     close(d_client);
-  }
-  else {
+  } else {
     string lines=l;
     if(!lines.empty() && lines[lines.length()-1] != '\n')
       lines.append("\n");
@@ -342,22 +341,18 @@ void DynListener::theListener()
         sendlines("Unknown command: '"+parts[0]+"'");
     }
   }
-  catch(PDNSException &AE)
-    {
-      L<<Logger::Error<<"Fatal error in control listener: "<<AE.reason<<endl;
-    }
-  catch(string &E)
-    {
-      L<<Logger::Error<<"Fatal error 2 in control listener: "<<E<<endl;
-    }
-  catch(std::exception& e)
-    {
-      L<<Logger::Error<<"Fatal STL error: "<<e.what()<<endl;
-    }
-  catch(...)
-    {
-      L<<Logger::Error<<"Fatal: unknown exception occured"<<endl;
-    }
+  catch(PDNSException &AE) {
+    L<<Logger::Error<<"Fatal error in control listener: "<<AE.reason<<endl;
+  }
+  catch(string &E) {
+    L<<Logger::Error<<"Fatal error 2 in control listener: "<<E<<endl;
+  }
+  catch(std::exception& e) {
+    L<<Logger::Error<<"Fatal STL error: "<<e.what()<<endl;
+  }
+  catch(...) {
+    L<<Logger::Error<<"Fatal: unknown exception occured"<<endl;
+  }
 }
 
 
@@ -379,8 +374,7 @@ string DynListener::getHelp()
 
   const boost::format fmter("%|-32| %||");
 
-  for(g_funkdb_t::const_iterator i=s_funcdb.begin();i!=s_funcdb.end();++i)
-  {
+  for(g_funkdb_t::const_iterator i=s_funcdb.begin();i!=s_funcdb.end();++i) {
     funcs.push_back(str(boost::format(fmter) % (toLower(i->first)+" "+i->second.args) % i->second.usage));
   }
   sort(funcs.begin(), funcs.end());
@@ -388,5 +382,4 @@ string DynListener::getHelp()
   // hack: this removes the duplicate quit method
   funcs.resize(unique(funcs.begin(), funcs.end()) - funcs.begin());
   return boost::join(funcs, "\n");
-}
-
+}
\ No newline at end of file