8 * 2 - service-2 with watchoutput and pidfile
10 * 4 - process-2 with pipefd or it_forked
13 void send_proc(proc_t p)
15 if (p->it_forked > 0 || p->pipefd >= 0) {
18 send_int(p->it_forked);
21 send_byte(3); /* process */
24 send_int(p->start_time);
25 send_int(p->hold_time);
26 send_int(p->exit_time);
30 void send_service(service_t sv)
34 if (sv->watch_output || sv->pidfile)
37 send_byte(1); /* service */
38 send_str(sv->service);
39 send_int(sv->max_proc);
40 send_str(sv->home_dir);
41 send_str(sv->username);
42 send_str(sv->crash_prog);
43 if (sv->watch_output || sv->pidfile) {
44 send_int(sv->watch_output);
45 send_str(sv->pidfile);
47 send_int(sv->start_cnt);
48 send_int(sv->enabled);
49 send_str(sv->program);
50 for (i=0 ; sv->args[i] ; i++)
53 for (i=0 ; sv->args[i] ; i++)
54 send_str(sv->args[i]);
55 (sv->class->send_class)(sv);
56 for (pp = skip_first(sv->proc_list) ; pp ; pp = skip_next(pp))
62 send_byte((i>>24)& 0xff);
63 send_byte((i>>16)& 0xff);
64 send_byte((i>> 8)& 0xff);
65 send_byte((i>> 0)& 0xff);
68 void send_str(char *s)
73 send_int(strlen(s)+1);
80 static char *sendbuf = NULL;
86 if (sendptr >= sendsize) {
88 sendbuf = (char*)realloc(sendbuf, sendsize);
90 sendbuf[sendptr++] = b;
96 if (sendbuf == NULL) {
98 sendbuf = malloc(sendsize);
102 void do_send(void *con)
104 set_reply(con, sendbuf, sendptr);
109 char *get_return(int *i)