mirror of https://github.com/aria2/aria2
2009-05-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed unnecessary BDE() call; leave them to implicit conversion. * src/XmlRpcMethodImpl.ccpull/1/head
parent
7c24aa3b97
commit
1d2cfd93d7
|
@ -1,3 +1,8 @@
|
||||||
|
2009-05-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Removed unnecessary BDE() call; leave them to implicit conversion.
|
||||||
|
* src/XmlRpcMethodImpl.cc
|
||||||
|
|
||||||
2009-05-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2009-05-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Return connections and gid in string
|
Return connections and gid in string
|
||||||
|
|
|
@ -68,7 +68,7 @@ namespace xmlrpc {
|
||||||
static BDE createGIDResponse(int32_t gid)
|
static BDE createGIDResponse(int32_t gid)
|
||||||
{
|
{
|
||||||
BDE resParams = BDE::list();
|
BDE resParams = BDE::list();
|
||||||
resParams << BDE(Util::itos(gid));
|
resParams << Util::itos(gid);
|
||||||
return resParams;
|
return resParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,30 +167,30 @@ BDE RemoveXmlRpcMethod::process(const XmlRpcRequest& req, DownloadEngine* e)
|
||||||
static void gatherProgressCommon
|
static void gatherProgressCommon
|
||||||
(BDE& entryDict, const SharedHandle<RequestGroup>& group)
|
(BDE& entryDict, const SharedHandle<RequestGroup>& group)
|
||||||
{
|
{
|
||||||
entryDict["gid"] = BDE(Util::itos(group->getGID()));
|
entryDict["gid"] = Util::itos(group->getGID());
|
||||||
entryDict["totalLength"] = BDE(Util::uitos(group->getTotalLength()));
|
entryDict["totalLength"] = Util::uitos(group->getTotalLength());
|
||||||
entryDict["completedLength"] = BDE(Util::uitos(group->getCompletedLength()));
|
entryDict["completedLength"] = Util::uitos(group->getCompletedLength());
|
||||||
TransferStat stat = group->calculateStat();
|
TransferStat stat = group->calculateStat();
|
||||||
entryDict["downloadSpeed"] = BDE(Util::uitos(stat.getDownloadSpeed()));
|
entryDict["downloadSpeed"] = Util::uitos(stat.getDownloadSpeed());
|
||||||
entryDict["uploadSpeed"] = BDE(Util::uitos(stat.getUploadSpeed()));
|
entryDict["uploadSpeed"] = Util::uitos(stat.getUploadSpeed());
|
||||||
entryDict["connections"] = BDE(Util::uitos(group->getNumConnection()));
|
entryDict["connections"] = Util::uitos(group->getNumConnection());
|
||||||
SharedHandle<PieceStorage> ps = group->getPieceStorage();
|
SharedHandle<PieceStorage> ps = group->getPieceStorage();
|
||||||
if(!ps.isNull()) {
|
if(!ps.isNull()) {
|
||||||
if(ps->getBitfieldLength() > 0) {
|
if(ps->getBitfieldLength() > 0) {
|
||||||
entryDict["bitfield"] = BDE(Util::toHex(ps->getBitfield(),
|
entryDict["bitfield"] = Util::toHex(ps->getBitfield(),
|
||||||
ps->getBitfieldLength()));
|
ps->getBitfieldLength());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
entryDict["pieceLength"] =
|
entryDict["pieceLength"] =
|
||||||
BDE(Util::uitos(group->getDownloadContext()->getPieceLength()));
|
Util::uitos(group->getDownloadContext()->getPieceLength());
|
||||||
entryDict["numPieces"] =
|
entryDict["numPieces"] =
|
||||||
BDE(Util::uitos(group->getDownloadContext()->getNumPieces()));
|
Util::uitos(group->getDownloadContext()->getNumPieces());
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gatherProgressBitTorrent
|
static void gatherProgressBitTorrent
|
||||||
(BDE& entryDict, const SharedHandle<BtContext>& btctx)
|
(BDE& entryDict, const SharedHandle<BtContext>& btctx)
|
||||||
{
|
{
|
||||||
entryDict["infoHash"] = BDE(btctx->getInfoHashAsString());
|
entryDict["infoHash"] = btctx->getInfoHashAsString();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gatherPeer(BDE& peers, const SharedHandle<PeerStorage>& ps)
|
static void gatherPeer(BDE& peers, const SharedHandle<PeerStorage>& ps)
|
||||||
|
@ -200,12 +200,12 @@ static void gatherPeer(BDE& peers, const SharedHandle<PeerStorage>& ps)
|
||||||
for(std::deque<SharedHandle<Peer> >::const_iterator i =
|
for(std::deque<SharedHandle<Peer> >::const_iterator i =
|
||||||
activePeers.begin(); i != activePeers.end(); ++i) {
|
activePeers.begin(); i != activePeers.end(); ++i) {
|
||||||
BDE peerEntry = BDE::dict();
|
BDE peerEntry = BDE::dict();
|
||||||
peerEntry["peerId"] = BDE(Util::torrentUrlencode((*i)->getPeerId(),
|
peerEntry["peerId"] = Util::torrentUrlencode((*i)->getPeerId(),
|
||||||
PEER_ID_LENGTH));
|
PEER_ID_LENGTH);
|
||||||
peerEntry["ip"] = BDE((*i)->ipaddr);
|
peerEntry["ip"] = (*i)->ipaddr;
|
||||||
peerEntry["port"] = BDE(Util::uitos((*i)->port));
|
peerEntry["port"] = Util::uitos((*i)->port);
|
||||||
peerEntry["bitfield"] = BDE(Util::toHex((*i)->getBitfield(),
|
peerEntry["bitfield"] = Util::toHex((*i)->getBitfield(),
|
||||||
(*i)->getBitfieldLength()));
|
(*i)->getBitfieldLength());
|
||||||
peers << peerEntry;
|
peers << peerEntry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -224,7 +224,7 @@ static void gatherProgress
|
||||||
static void gatherStoppedDownload
|
static void gatherStoppedDownload
|
||||||
(BDE& entryDict, const SharedHandle<DownloadResult>& ds)
|
(BDE& entryDict, const SharedHandle<DownloadResult>& ds)
|
||||||
{
|
{
|
||||||
entryDict["gid"] = BDE(Util::itos(ds->gid));
|
entryDict["gid"] = Util::itos(ds->gid);
|
||||||
if(ds->result == DownloadResult::IN_PROGRESS) {
|
if(ds->result == DownloadResult::IN_PROGRESS) {
|
||||||
entryDict["status"] = BDE("removed");
|
entryDict["status"] = BDE("removed");
|
||||||
} else if(ds->result == DownloadResult::FINISHED) {
|
} else if(ds->result == DownloadResult::FINISHED) {
|
||||||
|
|
Loading…
Reference in New Issue