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

Diff of /monit/protocols/ftp.c

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

revision 1.12 by hauk, Sat Oct 25 19:17:14 2003 UTC revision 1.13 by hauk, Mon Nov 3 14:47:48 2003 UTC
# Line 52  int check_ftp(Socket_T s) { Line 52  int check_ftp(Socket_T s) {
52    
53    ASSERT(s);    ASSERT(s);
54    
55    if(socket_read(s, buf, sizeof(buf)) <= 0) {    if(! socket_readln(s, buf, STRLEN)) {
56      log("FTP: error receiving data -- %s\n", STRERROR);      log("FTP: error receiving data -- %s\n", STRERROR);
57      return FALSE;      return FALSE;
58    }    }
# Line 65  int check_ftp(Socket_T s) { Line 65  int check_ftp(Socket_T s) {
65      return FALSE;      return FALSE;
66    }    }
67    
68      /* Read past banners */
69      while(NULL != socket_readln(s, buf, STRLEN)) {
70        if(starts_with(buf, "220")) continue;
71      }
72      
73    if(socket_print(s, "QUIT\r\n") < 0) {    if(socket_print(s, "QUIT\r\n") < 0) {
74      log("FTP: error sending data -- %s\n", STRERROR);      log("FTP: error sending data -- %s\n", STRERROR);
75      return FALSE;      return FALSE;
76    }    }
77    
78    if(socket_read(s, buf, sizeof(buf)) <= 0) {    if(socket_read(s, buf, STRLEN) <= 0) {
79      log("FTP: error receiving data -- %s\n", STRERROR);      log("FTP: error receiving data -- %s\n", STRERROR);
80      return FALSE;      return FALSE;
81    }    }

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

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