forked from Mirrors/privacore-open-source-search-engine
Fix admin/spiderdb json output
This commit is contained in:
@ -519,6 +519,13 @@ static bool generatePageJSON(CollectionRec *cr, SafeBuf *sb, const SafeBuf *dole
|
||||
j++;
|
||||
}
|
||||
|
||||
if (j > 0) {
|
||||
sb->removeLastChar('\n');
|
||||
sb->removeLastChar(',');
|
||||
sb->removeLastChar('\t');
|
||||
sb->removeLastChar('\t');
|
||||
}
|
||||
|
||||
// end the table
|
||||
sb->safePrintf("\t]\n");
|
||||
|
||||
@ -549,6 +556,13 @@ static bool generatePageJSON(CollectionRec *cr, SafeBuf *sb, const SafeBuf *dole
|
||||
return false;
|
||||
}
|
||||
|
||||
if (doledbbuf->length() > 0) {
|
||||
sb->removeLastChar('\n');
|
||||
sb->removeLastChar(',');
|
||||
sb->removeLastChar('\t');
|
||||
sb->removeLastChar('\t');
|
||||
}
|
||||
|
||||
sb->safePrintf("\t],\n");
|
||||
|
||||
/////////////////
|
||||
|
@ -228,10 +228,6 @@ int32_t SpiderReply::print(SafeBuf *sbarg) const {
|
||||
* }
|
||||
*/
|
||||
int32_t SpiderRequest::printToJSON(SafeBuf *sb, const char *status, const XmlDoc *xd, int32_t row) const {
|
||||
if (row != 0) {
|
||||
sb->safePrintf("\t\t,\n");
|
||||
}
|
||||
|
||||
sb->safePrintf("\t\t{\n");
|
||||
|
||||
int64_t elapsedMS = 0;
|
||||
@ -268,6 +264,7 @@ int32_t SpiderRequest::printToJSON(SafeBuf *sb, const char *status, const XmlDoc
|
||||
// if ( m_hasAuthorityInlink ) sb->safePrintf("HASAUTHORITYINLINK ");
|
||||
|
||||
sb->safePrintf("\t\t}\n");
|
||||
sb->safePrintf("\t\t,\n");
|
||||
|
||||
return sb->length();
|
||||
}
|
||||
|
Reference in New Issue
Block a user