httpconnection: Make sure torrent file is written in binary mode

This commit is contained in:
Christophe Dumez 2011-09-28 19:58:45 +03:00
commit 9115a2ddc2

View file

@ -402,6 +402,8 @@ void HttpConnection::respondCommand(const QString& command) {
// it fails to load on Windows.
QTemporaryFile *tmpfile = new QTemporaryFile (QDir::temp().absoluteFilePath("qBT-XXXXXX.torrent"));
if (tmpfile->open()) {
// Make sure we are writing in binary mode
tmpfile->setTextModeEnabled(false);
tmpfile->write(m_parser.torrent());
tmpfile->close();
emit torrentReadyToBeDownloaded(tmpfile->fileName(), false, QString(), false);