summarylogtreecommitdiffstats
path: root/ps-object_std-map-serialization_all.patch
blob: b476f84cd7004938a3dfdcf62f7770e5b53c8ce5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--- a/src/rpc/parse.cc
+++ b/src/rpc/parse.cc
@@ -506,6 +506,21 @@ print_object_std(std::string* dest, const torrent::Object* src, int flags) {
 
     return;
 
+  case torrent::Object::TYPE_MAP:
+  {
+    bool first = true;
+    for (torrent::Object::map_const_iterator itr = src->as_map().begin(), itrEnd = src->as_map().end(); itr != itrEnd; itr++) {
+      if (!first) *dest += ", ";
+      *dest += itr->first;
+      *dest += ": \"";
+      print_object_std(dest, &(itr->second), flags);
+      *dest += '"';
+      first = false;
+    }
+
+    return;
+  }
+
   case torrent::Object::TYPE_NONE:
     return;
   default: