[Pdns-users] Pdns Remote vs Pipe backend performance

Aki Tuomi cmouse at youzen.ext.b2.fi
Wed Mar 6 14:22:18 UTC 2013


> --- pdns-3.2.orig/modules/pipebackend/coprocess.cc    2013-01-17
> 13:16:53.000000000 +0400
> +++ pdns-3.2/modules/pipebackend/coprocess.cc    2013-03-02
> 15:12:04.415022452 +0400
> @@ -9,12 +9,20 @@
>  #include <sys/wait.h>
>  #include <pdns/misc.hh>
>  #include <pdns/ahuexception.hh>
> +#include <boost/algorithm/string.hpp>
> +#include <vector>
> 
>  CoProcess::CoProcess(const string &command,int timeout, int infd,
> int outfd)
>  {
> -  const char *argv[2];
> -  argv[0]=strdup(command.c_str());
> -  argv[1]=0;
> +  vector <string> v;
> +
> +  split(v, command, is_any_of(" "));
> +
> +  const char *argv[v.size()+1];
> +
> +  for (size_t n = 0; n < v.size(); n++)
> +    argv[n]=strdup(v[n].c_str());
> +  argv[v.size()]=0;
> 
>    launch(argv,timeout,infd,outfd);
>  }
> 

Could you please open a ticket about the patch above so we could get it
included in to powerdns, it looks really useful to me. +1

Aki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20130306/f9232f4d/attachment-0001.sig>


More information about the Pdns-users mailing list