parent
f26b499bf5
commit
a8e693eb59
|
@ -347,12 +347,6 @@ void FtpSession::handleFtpCommandPASV(const std::string & /*param*/)
|
|||
auto ip_bytes = command_socket_.local_endpoint().address().to_v4().to_bytes();
|
||||
auto port = data_acceptor_.local_endpoint().port();
|
||||
|
||||
// Form reply string
|
||||
std::stringstream stream;
|
||||
stream << "(";
|
||||
for (size_t i = 0; i < 4; i++) {
|
||||
stream << static_cast<int>(ip_bytes[i]) << ",";
|
||||
}
|
||||
std::ifstream file;
|
||||
|
||||
file.open(DEVICEID_FILE_LOACLPATH, std::ios_base::in);
|
||||
|
@ -370,6 +364,14 @@ void FtpSession::handleFtpCommandPASV(const std::string & /*param*/)
|
|||
}
|
||||
file.close();
|
||||
|
||||
// Form reply string
|
||||
std::stringstream stream;
|
||||
stream << "(";
|
||||
for (size_t i = 0; i < 4; i++) {
|
||||
stream << static_cast<int>(ip_bytes[i]) << ",";
|
||||
}
|
||||
stream << ((port >> 8) & 0xff) << "," << (port & 0xff) << ")";
|
||||
|
||||
sendFtpMessage(FtpReplyCode::ENTERING_PASSIVE_MODE, "Entering passive mode " + stream.str());
|
||||
return;
|
||||
} // namespace fineftp
|
||||
|
|
Loading…
Reference in New Issue