From 268d08dd305cc2cfd26d6247d2f14d236b6b7e17 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 24 Feb 2017 22:20:13 -0500 Subject: [PATCH] mgr/DaemonServer: use stringstream ds in local scope Signed-off-by: Sage Weil --- src/mgr/DaemonServer.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index f130d53a12e..7d2e2abb2af 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -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); -- 2.47.3