]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/DaemonServer: use stringstream ds in local scope
authorSage Weil <sage@redhat.com>
Sat, 25 Feb 2017 03:20:13 +0000 (22:20 -0500)
committerSage Weil <sage@redhat.com>
Wed, 29 Mar 2017 15:39:25 +0000 (11:39 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mgr/DaemonServer.cc

index f130d53a12e0d536dffd8638f3cdd2fc9e1ce503..7d2e2abb2aff0e9a9a01905b7f2906c7066613b5 100644 (file)
@@ -267,7 +267,6 @@ bool DaemonServer::handle_command(MCommand *m)
 {
   int r = 0;
   std::stringstream ss;
-  std::stringstream ds;
   bufferlist odata;
   std::string prefix;
 
@@ -328,8 +327,6 @@ bool DaemonServer::handle_command(MCommand *m)
     }
 #endif
     f.close_section(); // command_descriptions
-
-    f.flush(ds);
     goto out;
   } else {
     // Let's find you a handler!
@@ -355,7 +352,9 @@ bool DaemonServer::handle_command(MCommand *m)
     // with a ms_dispatch, so that the python part can block if it
     // wants to.
     dout(4) << "passing through " << cmdmap.size() << dendl;
+    stringstream ds;
     r = handler->handle_command(cmdmap, &ds, &ss);
+    odata.append(ds);
     goto out;
   }
 
@@ -368,7 +367,6 @@ bool DaemonServer::handle_command(MCommand *m)
 
   std::string rs;
   rs = ss.str();
-  odata.append(ds);
   dout(1) << "do_command r=" << r << " " << rs << dendl;
   if (con) {
     MCommandReply *reply = new MCommandReply(r, rs);