]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Guardian->instance communication cleand up, with terminating character \0
authorRuben d'Arco <cyclops@prof-x.net>
Mon, 30 Apr 2012 06:15:12 +0000 (08:15 +0200)
committerRuben d'Arco <cyclops@prof-x.net>
Tue, 7 May 2013 20:28:32 +0000 (22:28 +0200)
pdns/dynlistener.cc
pdns/receiver.cc

index c2a2d0dbe33585a9344e61a57160fd7a65bed32d..2b4929b11877872bcd68831c8b912df3775922db 100755 (executable)
@@ -271,7 +271,8 @@ void DynListener::sendLine(const string &l)
     string line=l;
     if(!line.empty() && line[line.length()-1]!='\n')
       line.append("\n");
-    line.append("\n");
+    line.append(1, '\0');
+    line.append(1, '\n');
     if((unsigned int)write(1,line.c_str(),line.length()) != line.length())
       L<<Logger::Error<<"Error sending data to console: "<<stringerror()<<endl;
       
index 92e71540a091b3fbbd9a31fad1667ce49d99b1b3..c3c2595a4f7529d8d93ae945b43ef583d3521f6b 100755 (executable)
@@ -166,7 +166,7 @@ static string DLRestHandler(const vector<string>&parts, pid_t ppid)
   char mesg[512];
   string response;
   while(fgets(mesg,sizeof(mesg),g_fp)) {
-    if(*mesg=='\n')
+    if(*mesg=='\0')
       break;
     response+=mesg;
   }