pike.git / NT / tools / sprshd

version» Context lines:

pike.git/NT/tools/sprshd:78:   {    return ( ( ((p1||"") + ";" + (p2||"")) / ";" ) - ({""}) ) * ";";   }      Thread.Mutex outlock=Thread.Mutex();      void myproxy(object pi, object io, int channel)   {    while(1)    { -  string s=pi->read(1000,1); +  string s=pi->read(1000,1); // Don't read more than 2<<24 :)    if(!s || !strlen(s)) break;    object key=outlock->lock(); -  io->write(sprintf("%c%3c%s",channel,strlen(s),channel,s)); +  io->write(sprintf("%c%3c%s",channel,strlen(s),s));    destruct(key);    }   }      void handle_incoming_connection(object(Stdio.File) io)   {    object p;    mapping env=copy_value(getenv());    sscanf(io->read(4),"%4c",int args);    string *cmd=allocate(args);    for(int e=0;e<args;e++)    {    sscanf(io->read(4),"%4c",int len);    cmd[e]=io->read(len);    }       object pi=Stdio.File();    object pe=Stdio.File();   #ifdef NO_IPC    object p2=pi->pipe(); -  object p23=pi->pipe(); +  object pe2=pe->pipe();   #else -  +  object p2=pi->pipe(Stdio.PROP_IPC);    object pe2=pe->pipe(Stdio.PROP_IPC);   #endif    string dir=cmd[0];    cmd=cmd[1..];       while(sscanf(cmd[0],"%s=%s",string key, string val))    {    // Magic    if(!env[key])    {