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

Diff of /monit/sendmail.c

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

revision 1.23 by hauk, Wed Sep 17 20:27:08 2003 UTC revision 1.24 by hauk, Tue Sep 30 16:03:13 2003 UTC
# Line 157  void sendmail(Mail_T mail) { Line 157  void sendmail(Mail_T mail) {
157    do_send(&S, "QUIT\r\n");    do_send(&S, "QUIT\r\n");
158        
159    exit:    exit:
160    free(S.now);    FREE(S.now);
161    if(S.socket) {    if(S.socket) {
162      socket_free(&S.socket);      socket_free(&S.socket);
163    }    }
# Line 168  void sendmail(Mail_T mail) { Line 168  void sendmail(Mail_T mail) {
168  /* ----------------------------------------------------------------- Private */  /* ----------------------------------------------------------------- Private */
169    
170    
171  void do_send(SendMail_T *S, const char *format, ...) {  void do_send(SendMail_T *S, const char *s, ...) {
172        
173      long len;
174    va_list ap;    va_list ap;
175    char msg[2048];    char *msg= NULL;
176        
177    va_start(ap,format);    va_start(ap,s);
178    vsnprintf(msg, 2048, format, ap);    msg= format(s, ap, &len);
179    va_end(ap);    va_end(ap);
180        
181    if(socket_write(S->socket, msg, strlen(msg)) <= 0) {    if(socket_write(S->socket, msg, strlen(msg)) <= 0) {
182        
183        FREE(msg);
184      log("Sendmail: error sending data to the server '%s' -- %s\n",      log("Sendmail: error sending data to the server '%s' -- %s\n",
185          S->server, STRERROR);          S->server, STRERROR);
186      siglongjmp(S->error, TRUE);      siglongjmp(S->error, TRUE);
187            
188    }    }
189      
190      FREE(msg);
191    
192  }  }
193    
194    

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

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