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); |
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) { |
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); |