|
Lines 758-764
Link Here
|
| 758 |
} |
758 |
} |
| 759 |
|
759 |
|
| 760 |
// 229 Entering Extended Passive Mode (|||55016|) |
760 |
// 229 Entering Extended Passive Mode (|||55016|) |
| 761 |
char *begin = strchr(socket()->getResponse().ascii(), '('); |
761 |
const char *begin = strchr(socket()->getResponse().ascii(), '('); |
| 762 |
int port; |
762 |
int port; |
| 763 |
|
763 |
|
| 764 |
if (!begin || sscanf(begin, "(|||%d|)", &port) != 1) { |
764 |
if (!begin || sscanf(begin, "(|||%d|)", &port) != 1) { |
|
Lines 793-804
Link Here
|
| 793 |
|
793 |
|
| 794 |
// Ok PASV command successfull - let's parse the result |
794 |
// Ok PASV command successfull - let's parse the result |
| 795 |
int ip[6]; |
795 |
int ip[6]; |
| 796 |
char *begin = strchr(socket()->getResponse().ascii(), '('); |
796 |
const char *begin = strchr(socket()->getResponse().ascii(), '('); |
| 797 |
|
797 |
|
| 798 |
// Some stinky servers don't respect RFC and do it on their own |
798 |
// Some stinky servers don't respect RFC and do it on their own |
| 799 |
if (!begin) |
799 |
if (!begin) { |
| 800 |
begin = strchr(socket()->getResponse().ascii(), '='); |
800 |
delete &begin; |
| 801 |
|
801 |
const char *begin = strchr(socket()->getResponse().ascii(), '='); |
|
|
802 |
} |
| 803 |
|
| 802 |
if (!begin || (sscanf(begin, "(%d,%d,%d,%d,%d,%d)",&ip[0], &ip[1], &ip[2], &ip[3], &ip[4], &ip[5]) != 6 && |
804 |
if (!begin || (sscanf(begin, "(%d,%d,%d,%d,%d,%d)",&ip[0], &ip[1], &ip[2], &ip[3], &ip[4], &ip[5]) != 6 && |
| 803 |
sscanf(begin, "=%d,%d,%d,%d,%d,%d",&ip[0], &ip[1], &ip[2], &ip[3], &ip[4], &ip[5]) != 6)) { |
805 |
sscanf(begin, "=%d,%d,%d,%d,%d,%d",&ip[0], &ip[1], &ip[2], &ip[3], &ip[4], &ip[5]) != 6)) { |
| 804 |
// Unable to parse, try the next thing |
806 |
// Unable to parse, try the next thing |