Menu

#6 Passive FTP fails on i386

open
nobody
PP (1)
5
2015-02-07
2006-12-01
No

I would've submitted a patch, but I'm new to this. The problem is in LFTPConnection::SendPASV(). When it extracts the port from the PASV response it stuffs it into a PPC (big endian) specific format. I had to make the following change to support i386.

p = (char*)(outPort);
#ifdef __BIG_ENDIAN__
// ppc version
currTok = PP_CSTD::strtok(nil, "(), ."); //a1...Host port
p[0] = (char) (PP_CSTD::strtol(currTok, nil, 10) & 0xff);

currTok = PP_CSTD::strtok(nil, "(), ."); //a1
p[1] = (char) (PP_CSTD::strtol(currTok, nil, 10) & 0xff);
#else
// i386 version
p = (char*)(outPort);
currTok = PP_CSTD::strtok(nil, "(), ."); //a1...Host port
p[1] = (char) (PP_CSTD::strtol(currTok, nil, 10) & 0xff);

currTok = PP_CSTD::strtok(nil, "(), ."); //a1
p[0] = (char) (PP_CSTD::strtol(currTok, nil, 10) & 0xff);
#endif

Discussion


Log in to post a comment.

MongoDB Logo MongoDB