2010-03-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Fixed the bug that value of numSeeders in aria2.tellStatus XML-RPC
	method response is integer, while manual says it is string.  When
	peer's port is not listening port, set '0' to port in
	aria2.getPeers response.
	* src/XmlRpcMethodImpl.cc
pull/1/head
Tatsuhiro Tsujikawa 2010-03-19 14:22:17 +00:00
parent e0335dcd4f
commit d6860e11bf
2 changed files with 15 additions and 2 deletions

View File

@ -1,3 +1,11 @@
2010-03-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that value of numSeeders in aria2.tellStatus XML-RPC
method response is integer, while manual says it is string. When
peer's port is not listening port, set '0' to port in
aria2.getPeers response.
* src/XmlRpcMethodImpl.cc
2010-03-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Lines starting "#" in -i list are treated as comments.

View File

@ -463,7 +463,8 @@ static void gatherProgressBitTorrent
std::vector<SharedHandle<Peer> > peers;
peerStorage->getActivePeers(peers);
entryDict[KEY_NUM_SEEDERS] = countSeeder(peers.begin(), peers.end());
entryDict[KEY_NUM_SEEDERS] =
util::uitos(countSeeder(peers.begin(), peers.end()));
}
}
@ -477,7 +478,11 @@ static void gatherPeer(BDE& peers, const SharedHandle<PeerStorage>& ps)
peerEntry[KEY_PEER_ID] = util::torrentPercentEncode((*i)->getPeerId(),
PEER_ID_LENGTH);
peerEntry[KEY_IP] = (*i)->ipaddr;
if((*i)->isIncomingPeer()) {
peerEntry[KEY_PORT] = std::string("0");
} else {
peerEntry[KEY_PORT] = util::uitos((*i)->port);
}
peerEntry[KEY_BITFIELD] = util::toHex((*i)->getBitfield(),
(*i)->getBitfieldLength());
peerEntry[KEY_AM_CHOKING] = (*i)->amChoking()?BDE_TRUE:BDE_FALSE;