Skip to content
Permalink
Browse files

fixed empty jsonobj creation

  • Loading branch information...
glookka committed Jan 30, 2019
1 parent a5d41f9 commit 3f6d23891064ee8e94030c4231497cdd7da33a6a
Showing with 7 additions and 4 deletions.
  1. +3 −3 src/searchdhttp.cpp
  2. +4 −1 src/searchdreplication.cpp
@@ -936,7 +936,7 @@ class HttpHandler_JsonInsert_c : public HttpHandler_c, public HttpJsonInsertTrai
return false;
}

JsonObj_c tResult;
JsonObj_c tResult = JsonNull;
bool bResult = ProcessInsert ( tStmt, tDocId, m_bReplace, tResult );

CSphString sResult = tResult.AsString();
@@ -989,7 +989,7 @@ class HttpHandler_JsonUpdate_c : public HttpHandler_c, HttpJsonUpdateTraits_c
return false;
}

JsonObj_c tResult;
JsonObj_c tResult = JsonNull;
bool bResult = ProcessQuery ( tStmt, tDocId, tResult );
BuildReply ( tResult.AsString(), bResult ? SPH_HTTP_STATUS_200 : SPH_HTTP_STATUS_500 );

@@ -1104,7 +1104,7 @@ class HttpHandler_JsonBulk_c : public HttpHandler_c, public HttpOptionsTraits_c,
return false;
}

JsonObj_c tResult;
JsonObj_c tResult = JsonNull;
bResult = false;

switch ( tStmt.m_eStmt )
@@ -1955,7 +1955,10 @@ void JsonConfigDumpClusters ( const SmallStringHash_T<ReplicationCluster_t *> &
// index array
JsonObj_c tIndexes(true);
for ( const CSphString & sIndex : pCluster->m_dIndexes )
tIndexes.AddItem ( JsonObj_c::CreateStr(sIndex) );
{
JsonObj_c tStrItem = JsonObj_c::CreateStr(sIndex);
tIndexes.AddItem(tStrItem);
}

tItem.AddItem ( "indexes", tIndexes );
}

0 comments on commit 3f6d238

Please sign in to comment.
You can’t perform that action at this time.