/[monit]/monit/status.c
ViewVC logotype

Diff of /monit/status.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by hauk, Fri Sep 6 09:54:52 2002 UTC revision 1.10 by hauk, Fri Sep 6 10:39:29 2002 UTC
# Line 169  static int remote_status(Process_T p) { Line 169  static int remote_status(Process_T p) {
169        return FALSE;        return FALSE;
170                            
171      } else {      } else {
172          
173          int n;
174        char req[2*STRLEN];        char req[2*STRLEN];
175        char *auth= get_basic_authentication_header();        char *auth= get_basic_authentication_header();
176        char buf[STRLEN];        char buf[STRLEN];
# Line 179  static int remote_status(Process_T p) { Line 180  static int remote_status(Process_T p) {
180                
181        free(auth);        free(auth);
182        sock_send(s, req, sizeof(req), 0);        sock_send(s, req, sizeof(req), 0);
183        sock_recv(s, buf, STRLEN, 0);        
184          if(0>(n= sock_recv(s, buf, STRLEN, 0))) {
185            
186            local_status(p);
187            close_socket(s);
188            
189            return TRUE;
190            
191          }
192          
193        close_socket(s);        close_socket(s);
194    
195        /* If everything has gone well the returned string starts with        /* If everything has gone well the returned string starts with
196           "Process " */           "Process " */
197    
198          buf[n]= 0;
199        if(starts_with(buf, "Process ")) {        if(starts_with(buf, "Process ")) {
200    
201          fprintf(stdout, "%s", buf);          fprintf(stdout, "%s", buf);

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26