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

Diff of /monit/status.c

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

revision 1.28 by hauk, Tue Jun 17 02:04:57 2003 UTC revision 1.29 by hauk, Tue Jun 17 17:54:15 2003 UTC
# Line 259  static int remote_status(Service_T s) { Line 259  static int remote_status(Service_T s) {
259    
260        int n;        int n;
261        char buf[STRLEN];        char buf[STRLEN];
       char req[2*STRLEN];  
262        char *auth= get_basic_authentication_header();        char *auth= get_basic_authentication_header();
263    
264        snprintf(req, 2*STRLEN,        socket_print(sock, "GET /%s?action=status HTTP/1.0\r\n%s\r\n",
265                 "GET /%s?action=status HTTP/1.0\r\n%s\r\n", s->name, auth);                     s->name, auth);
         
266        free(auth);        free(auth);
267                
       socket_write(sock, req, sizeof(req));  
         
268        if(0>(n= socket_read(sock, buf, STRLEN))) {        if(0>(n= socket_read(sock, buf, STRLEN))) {
269                    
270          local_status(s);          local_status(s);
271          socket_close(&sock);          socket_free(&sock);
272                    
273          return TRUE;          return TRUE;
274                    
275        }        }
276                
277        socket_close(&sock);        socket_free(&sock);
278                    
279    
280        /* If everything has gone well the returned string starts with        /* If everything has gone well the returned string starts with

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

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