/[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.15 by chopp, Wed Feb 18 22:31:42 2004 UTC revision 1.16 by hauk, Sun Dec 12 23:45:09 2004 UTC
# Line 57  int check_ftp(Socket_T s) { Line 57  int check_ftp(Socket_T s) {
57      return FALSE;      return FALSE;
58    }    }
59    
60    chomp(buf, STRLEN);    Util_chomp(buf, STRLEN);
61        
62    /* RATS: ignore */ /* chomp does zero termination */    /* RATS: ignore */ /* Util_chomp does zero termination */
63    sscanf(buf, "%d %s", &status, msg);    sscanf(buf, "%d %s", &status, msg);
64    if(status != 220) {    if(status != 220) {
65      log("FTP error: %s\n", buf);      log("FTP error: %s\n", buf);
# Line 68  int check_ftp(Socket_T s) { Line 68  int check_ftp(Socket_T s) {
68    
69    /* Read past banners */    /* Read past banners */
70    while(NULL != socket_readln(s, buf, STRLEN)) {    while(NULL != socket_readln(s, buf, STRLEN)) {
71      if(starts_with(buf, "220")) continue;      if(Util_startsWith(buf, "220")) continue;
72    }    }
73        
74    if(socket_print(s, "QUIT\r\n") < 0) {    if(socket_print(s, "QUIT\r\n") < 0) {
# Line 81  int check_ftp(Socket_T s) { Line 81  int check_ftp(Socket_T s) {
81      return FALSE;      return FALSE;
82    }    }
83    
84    chomp(buf, STRLEN);    Util_chomp(buf, STRLEN);
85        
86    /* RATS: ignore */ /* chomp does zero termination */    /* RATS: ignore */ /* Util_chomp does zero termination */
87    sscanf(buf, "%d %s", &status, msg);    sscanf(buf, "%d %s", &status, msg);
88    if(status != 221) {    if(status != 221) {
89      log("FTP error: %s\n", buf);      log("FTP error: %s\n", buf);

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

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