Jelajahi Sumber

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

	Added "uris" key to the response of tellStatus command.  Added
	"connections" key to the response of tellStatus and tellActive
	command.
	* src/XmlRpcMethodImpl.cc
Tatsuhiro Tsujikawa 16 tahun lalu
induk
melakukan
45249392fd
2 mengubah file dengan 17 tambahan dan 1 penghapusan
  1. 7 0
      ChangeLog
  2. 10 1
      src/XmlRpcMethodImpl.cc

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2009-05-09  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Added "uris" key to the response of tellStatus command.  Added
+	"connections" key to the response of tellStatus and tellActive
+	command.
+	* src/XmlRpcMethodImpl.cc
+
 2009-05-09  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Renamed TellActiveStatusXmlRpcMethod as TellActiveXmlRpcMethod.

+ 10 - 1
src/XmlRpcMethodImpl.cc

@@ -172,7 +172,7 @@ static void gatherProgressCommon
   TransferStat stat = group->calculateStat();
   entryDict["downloadSpeed"] = BDE(Util::uitos(stat.getDownloadSpeed()));
   entryDict["uploadSpeed"] = BDE(Util::uitos(stat.getUploadSpeed()));
-    
+  entryDict["connections"] = group->getNumConnection();
   SharedHandle<PieceStorage> ps = group->getPieceStorage();
   if(!ps.isNull()) {
     if(ps->getBitfieldLength() > 0) {
@@ -229,6 +229,15 @@ static void gatherProgress
 {
   gatherProgressCommon(entryDict, group);
 
+  BDE uriList = BDE::list();
+  std::deque<std::string> uris;
+  group->getURIs(uris);
+  for(std::deque<std::string>::const_iterator i = uris.begin(); i != uris.end();
+      ++i) {
+    uriList << *i;
+  }
+  entryDict["uris"] = uriList;
+
   SharedHandle<BtContext> btctx =
     dynamic_pointer_cast<BtContext>(group->getDownloadContext());
   if(!btctx.isNull()) {