diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2011-01-14 19:15:37 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2011-01-26 13:15:15 (GMT) |
commit | 7012b6697df8472df5d772394edb0fbf7219da42 (patch) | |
tree | c0acef3ac95bc5fd032b0a1a6ffc4da041fc1f44 | |
parent | db3d9b67ac543ddfdac649bec2c1287982d50a4e (diff) | |
download | Qt-7012b6697df8472df5d772394edb0fbf7219da42.zip Qt-7012b6697df8472df5d772394edb0fbf7219da42.tar.gz Qt-7012b6697df8472df5d772394edb0fbf7219da42.tar.bz2 |
QNAM FTP: switch to binary mode before sending a SIZE command
With some servers, SIZE is not allowed in ASCII mode or it may return
different sizes. Since we transfer in binary anyway, better get the
size in binary too.
Reviewed-by: Peter Hartmann
-rw-r--r-- | src/network/access/qnetworkaccessftpbackend.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/access/qnetworkaccessftpbackend.cpp b/src/network/access/qnetworkaccessftpbackend.cpp index 42d2955..b0303aa 100644 --- a/src/network/access/qnetworkaccessftpbackend.cpp +++ b/src/network/access/qnetworkaccessftpbackend.cpp @@ -307,8 +307,10 @@ void QNetworkAccessFtpBackend::ftpDone() // logged in successfully, send the stat requests (if supported) QString command = url().path(); command.prepend(QLatin1String("%1 ")); - if (supportsSize) + if (supportsSize) { + ftp->rawCommand(QLatin1String("TYPE I")); sizeId = ftp->rawCommand(command.arg(QLatin1String("SIZE"))); // get size + } if (supportsMdtm) mdtmId = ftp->rawCommand(command.arg(QLatin1String("MDTM"))); // get modified time if (!supportsSize && !supportsMdtm) |