E.g., if there is no secrets, we don't open a session and
leave it haning after returning.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
int KeyServer::encode_secrets(Formatter *f, stringstream *ds) const
{
Mutex::Locker l(lock);
-
- if (f)
- f->open_array_section("auth_dump");
-
map<EntityName, EntityAuth>::const_iterator mapiter = data.secrets_begin();
if (mapiter == data.secrets_end())
return -ENOENT;
+ if (f)
+ f->open_array_section("auth_dump");
+
while (mapiter != data.secrets_end()) {
const EntityName& name = mapiter->first;
if (ds) {