#include #include #include #include #include using namespace std; int main (int argc, char *argv[]) { glocal int ret = -1; glocal const char *unixpath = "/var/run/http_proxy.sock"; glocal int rep = 1; glocal.ret = (argc,argv); setproginfo ("http_proxy-control",VERSION ,"Send commands and configuration to the http_proxy service\n" "\n" "Commands are:\n" "\tstatus\n" ); setarg ('s',"unixsock","Unix socket",glocal.unixpath,false); glocal int ret = -1; glocal string args; for (int i=0; i 0) glocal.args += " "; glocal.args += argv[i]; } for (int i=0; i("unix:",glocal.unixpath,1); sendf ("%s\n",glocal.args.c_str()); if (strcmp(line,"OK")==0){ glocal.ret = 0; end = true; }else if (strncmp(line,"ERR ",4)==0){ fprintf (stderr,"%s\n",line+4); end = true; }else{ printf ("%s\n",line); } } return glocal.ret; return glocal.ret; }