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

Diff of /monit/control.c

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

revision 1.2 by rory, Wed Oct 2 03:03:45 2002 UTC revision 1.3 by chopp, Tue Oct 8 11:34:37 2002 UTC
# Line 171  static void atomic_dcontrol_process(Proc Line 171  static void atomic_dcontrol_process(Proc
171    int s;    int s;
172    char req[2*STRLEN];    char req[2*STRLEN];
173    char *auth= get_basic_authentication_header();    char *auth= get_basic_authentication_header();
174      ssl_connection * ssl= NULL;
175    
176      if ( Run.httpdssl ) {
177    
178        ssl = new_ssl_connection();
179    
180      }
181    
182    s= create_socket(Run.bind_addr?Run.bind_addr:"localhost",    s= create_socket(Run.bind_addr?Run.bind_addr:"localhost",
183                     Run.httpdport, SOCK_STREAM);                     Run.httpdport, SOCK_STREAM);
# Line 183  static void atomic_dcontrol_process(Proc Line 190  static void atomic_dcontrol_process(Proc
190    else {    else {
191      snprintf(req, sizeof(req),      snprintf(req, sizeof(req),
192               "GET /%s?action=%s HTTP/1.0\r\n%s\r\n", p->name, action, auth);               "GET /%s?action=%s HTTP/1.0\r\n%s\r\n", p->name, action, auth);
193      sock_send(s, req, sizeof(req), 0);  
194      close_socket(s);      if ( ssl != NULL ) {
195    
196          if (!embed_ssl_socket(ssl, s)) {
197            
198            fprintf(stdout, "Failed establish SSL communication to monit"
199                    " server\n");
200    
201            return;
202          }
203    
204          send_ssl_socket(ssl, req, sizeof(req));
205          
206          close_ssl_socket(ssl);
207          close_socket(s);
208    
209        } else {
210    
211          sock_send(s, req, sizeof(req), 0);
212          close_socket(s);
213    
214        }
215      free(auth);      free(auth);
216    }    }
217        
218      if ( Run.httpdssl ) {
219    
220        delete_ssl_socket(ssl);
221    
222      }
223  }  }
224    
225    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

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