diff --git a/src/RpcMethodImpl.cc b/src/RpcMethodImpl.cc index e8284933..e9552a20 100644 --- a/src/RpcMethodImpl.cc +++ b/src/RpcMethodImpl.cc @@ -293,13 +293,13 @@ SharedHandle AddTorrentRpcMethod::process if(util::saveAs(filename, torrentParam->s(), true)) { A2_LOG_INFO(fmt("Uploaded torrent data was saved as %s", filename.c_str())); requestOption->put(PREF_TORRENT_FILE, filename); - createRequestGroupForBitTorrent(result, requestOption, uris); } else { A2_LOG_INFO(fmt("Uploaded torrent data was not saved." " Failed to write file %s", filename.c_str())); - createRequestGroupForBitTorrent(result, requestOption, - uris, torrentParam->s()); + filename.clear(); } + createRequestGroupForBitTorrent(result, requestOption, uris, filename, + torrentParam->s()); if(!result.empty()) { return addRequestGroup(result.front(), e, posGiven, pos); diff --git a/src/UTMetadataPostDownloadHandler.cc b/src/UTMetadataPostDownloadHandler.cc index 3dd9329d..13623fc1 100644 --- a/src/UTMetadataPostDownloadHandler.cc +++ b/src/UTMetadataPostDownloadHandler.cc @@ -97,7 +97,8 @@ void UTMetadataPostDownloadHandler::getNextRequestGroups // Don't adjust announce URI because it has been done when // RequestGroup is created with magnet URI. createRequestGroupForBitTorrent(newRgs, requestGroup->getOption(), - std::vector(), torrent, false); + std::vector(), + A2STR::NIL, torrent, false); requestGroup->followedBy(newRgs.begin(), newRgs.end()); if(requestGroup->getMetadataInfo()) { setMetadataInfo(newRgs.begin(), newRgs.end(), diff --git a/src/download_helper.cc b/src/download_helper.cc index 90707cd3..adec256c 100644 --- a/src/download_helper.cc +++ b/src/download_helper.cc @@ -242,13 +242,14 @@ void createRequestGroupForBitTorrent (std::vector >& result, const SharedHandle