]> granicus.if.org Git - pdns/commitdiff
hook up nodelay, silence output 'connecting to..' unless --verbose
authorbert hubert <bert.hubert@netherlabs.nl>
Tue, 26 Apr 2016 11:40:06 +0000 (13:40 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Tue, 26 Apr 2016 11:40:06 +0000 (13:40 +0200)
pdns/dnsdist-console.cc

index 22b128b249fb4006174b0ade11acb3751ffae42d..8d00418b8806fe86ebcbd428e78c6ced63fed21c 100644 (file)
@@ -18,14 +18,15 @@ void feedConfigDelta(const std::string& line)
 
 void doClient(ComboAddress server, const std::string& command)
 {
-  cout<<"Connecting to "<<server.toStringWithPort()<<endl;
+  if(g_verbose)
+    cout<<"Connecting to "<<server.toStringWithPort()<<endl;
   int fd=socket(server.sin4.sin_family, SOCK_STREAM, 0);
   if (fd < 0) {
     cerr<<"Unable to connect to "<<server.toStringWithPort()<<endl;
     return;
   }
   SConnect(fd, server);
-
+  setTCPNoDelay(fd);
   SodiumNonce theirs, ours;
   ours.init();
 
@@ -255,6 +256,7 @@ char** my_completion( const char * text , int start,  int end)
 void controlClientThread(int fd, ComboAddress client)
 try
 {
+  setTCPNoDelay(fd);
   SodiumNonce theirs;
   readn2(fd, (char*)theirs.value, sizeof(theirs.value));
   SodiumNonce ours;