/[monit]/monit/protocols/smtp.c
ViewVC logotype

Diff of /monit/protocols/smtp.c

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

revision 1.9 by martinp, Tue Feb 11 21:27:40 2003 UTC revision 1.10 by hauk, Thu Jul 24 00:35:25 2003 UTC
# Line 39  Line 39 
39   *   *
40   *  @file   *  @file
41   */   */
42  int check_smtp(Port_T p) {  int check_smtp(Socket_T s) {
43    
44    int status;    int status;
45    char buf[STRLEN];    char buf[STRLEN];
46    char msg[STRLEN];    char msg[STRLEN];
   const char *command= "QUIT\r\n";  
47    
48    ASSERT(p);    ASSERT(s);
49    
50    if(port_recv(p, buf, sizeof(buf), 0) <= 0) {    if(socket_read(s, buf, sizeof(buf)) <= 0) {
51      log("SMTP: error receiving data -- %s\n", STRERROR);      log("SMTP: error receiving data -- %s\n", STRERROR);
52      return FALSE;      return FALSE;
53    }    }
# Line 61  int check_smtp(Port_T p) { Line 60  int check_smtp(Port_T p) {
60      return FALSE;      return FALSE;
61    }    }
62    
63    if(port_send(p, command, strlen(command), 0) < 0) {    if(socket_print(s, "QUIT\r\n") < 0) {
64      log("SMTP: error sending data -- %s\n", STRERROR);      log("SMTP: error sending data -- %s\n", STRERROR);
65      return FALSE;      return FALSE;
66    }    }
67    
68    if(port_recv(p, buf, sizeof(buf), 0) <= 0) {    if(socket_read(s, buf, sizeof(buf)) <= 0) {
69      log("SMTP: error receiving data -- %s\n", STRERROR);      log("SMTP: error receiving data -- %s\n", STRERROR);
70      return FALSE;      return FALSE;
71    }    }

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