|
|
|
@ -758,7 +758,7 @@ public:
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 229 Entering Extended Passive Mode (|||55016|)
|
|
|
|
|
char *begin = strchr(socket()->getResponse().ascii(), '(');
|
|
|
|
|
const char *begin = strchr(socket()->getResponse().ascii(), '(');
|
|
|
|
|
int port;
|
|
|
|
|
|
|
|
|
|
if (!begin || sscanf(begin, "(|||%d|)", &port) != 1) {
|
|
|
|
@ -793,12 +793,14 @@ public:
|
|
|
|
|
|
|
|
|
|
// Ok PASV command successfull - let's parse the result
|
|
|
|
|
int ip[6];
|
|
|
|
|
char *begin = strchr(socket()->getResponse().ascii(), '(');
|
|
|
|
|
const char *begin = strchr(socket()->getResponse().ascii(), '(');
|
|
|
|
|
|
|
|
|
|
// Some stinky servers don't respect RFC and do it on their own
|
|
|
|
|
if (!begin)
|
|
|
|
|
begin = strchr(socket()->getResponse().ascii(), '=');
|
|
|
|
|
|
|
|
|
|
if (!begin) {
|
|
|
|
|
delete &begin;
|
|
|
|
|
const char *begin = strchr(socket()->getResponse().ascii(), '=');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!begin || (sscanf(begin, "(%d,%d,%d,%d,%d,%d)",&ip[0], &ip[1], &ip[2], &ip[3], &ip[4], &ip[5]) != 6 &&
|
|
|
|
|
sscanf(begin, "=%d,%d,%d,%d,%d,%d",&ip[0], &ip[1], &ip[2], &ip[3], &ip[4], &ip[5]) != 6)) {
|
|
|
|
|
// Unable to parse, try the next thing
|
|
|
|
|