2009-05-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Added web-seeding URI handling in addTorrent command.
	* src/XmlRpcMethodImpl.cc
pull/1/head
Tatsuhiro Tsujikawa 2009-05-13 12:42:34 +00:00
parent 98666d33b9
commit 9b9295ce4a
2 changed files with 15 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2009-05-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added web-seeding URI handling in addTorrent command.
* src/XmlRpcMethodImpl.cc
2009-05-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added "length" key to getFiles response.

View File

@ -113,7 +113,15 @@ BDE AddTorrentXmlRpcMethod::process
throw DlAbortEx("Torrent data is not provided.");
}
// TODO should accept uris from xml rpc request
std::deque<std::string> uris;
if(params.size() > 1 && params[1].isList()) {
for(BDE::List::const_iterator i = params[1].listBegin();
i != params[1].listEnd(); ++i) {
if((*i).isString()) {
uris.push_back((*i).s());
}
}
}
SharedHandle<Option> requestOption(new Option(*e->option));
if(params.size() > 2 && params[2].isDict()) {
@ -121,7 +129,7 @@ BDE AddTorrentXmlRpcMethod::process
}
std::deque<SharedHandle<RequestGroup> > result;
createRequestGroupForBitTorrent(result, requestOption,
std::deque<std::string>(),
uris,
params[0].s());
if(!result.empty()) {