mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
BUGFIX: Fix torrent upload from Web UI (Windows)
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.6.7
|
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.6.7
|
||||||
- BUGFIX: Encoding fixes (Windows)
|
- BUGFIX: Encoding fixes (Windows)
|
||||||
- BUGFIX: Fix "append label to save path" on Windows
|
- BUGFIX: Fix "append label to save path" (Windows)
|
||||||
- BUGFIX: Disable OS cache for aligned files to reduce memory consumption
|
- BUGFIX: Disable OS cache for aligned files to reduce memory consumption
|
||||||
|
- BUGFIX: Fix torrent upload from Web UI (Windows)
|
||||||
|
|
||||||
* Tue Feb 8 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.6.6
|
* Tue Feb 8 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.6.6
|
||||||
- FEATURE: IP address reported to trackers is now customizable
|
- FEATURE: IP address reported to trackers is now customizable
|
||||||
|
|||||||
@@ -825,6 +825,8 @@ QTorrentHandle QBtSession::addMagnetUri(QString magnet_uri, bool resumed) {
|
|||||||
qDebug("addMagnetURI: using save_path: %s", qPrintable(savePath));
|
qDebug("addMagnetURI: using save_path: %s", qPrintable(savePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qDebug("Adding magnet URI: %s", qPrintable(magnet_uri));
|
||||||
|
|
||||||
// Adding torrent to Bittorrent session
|
// Adding torrent to Bittorrent session
|
||||||
try {
|
try {
|
||||||
h = QTorrentHandle(add_magnet_uri(*s, magnet_uri.toStdString(), p));
|
h = QTorrentHandle(add_magnet_uri(*s, magnet_uri.toStdString(), p));
|
||||||
|
|||||||
@@ -389,23 +389,27 @@ void HttpConnection::respondCommand(QString command)
|
|||||||
QByteArray torrentfile = parser.torrent();
|
QByteArray torrentfile = parser.torrent();
|
||||||
// Get a unique filename
|
// Get a unique filename
|
||||||
QString filePath;
|
QString filePath;
|
||||||
QTemporaryFile tmpfile;
|
QTemporaryFile *tmpfile = new QTemporaryFile;
|
||||||
tmpfile.setAutoRemove(false);
|
tmpfile->setAutoRemove(false);
|
||||||
if (tmpfile.open()) {
|
if (tmpfile->open()) {
|
||||||
filePath = tmpfile.fileName();
|
filePath = tmpfile->fileName();
|
||||||
} else {
|
} else {
|
||||||
std::cerr << "I/O Error: Could not create temporary file" << std::endl;
|
std::cerr << "I/O Error: Could not create temporary file" << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tmpfile.close();
|
tmpfile->close();
|
||||||
// Now temporary file is created but closed so that it can be used.
|
// Now temporary file is created but closed so that it can be used.
|
||||||
// write torrent to temporary file
|
// write torrent to temporary file
|
||||||
QFile torrent(filePath);
|
QFile torrent(filePath);
|
||||||
if(torrent.open(QIODevice::WriteOnly)) {
|
if(torrent.open(QIODevice::WriteOnly)) {
|
||||||
torrent.write(torrentfile);
|
torrent.write(torrentfile);
|
||||||
torrent.close();
|
torrent.close();
|
||||||
|
} else {
|
||||||
|
std::cerr << "I/O Error: Could not create temporary file" << std::endl;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
emit torrentReadyToBeDownloaded(filePath, false, QString(), false);
|
emit torrentReadyToBeDownloaded(filePath, false, QString(), false);
|
||||||
|
delete tmpfile;
|
||||||
// Prepare response
|
// Prepare response
|
||||||
generator.setStatusLine(200, "OK");
|
generator.setStatusLine(200, "OK");
|
||||||
generator.setContentTypeByExt("html");
|
generator.setContentTypeByExt("html");
|
||||||
|
|||||||
Reference in New Issue
Block a user