0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-14 05:51:10 +01:00

ircd::json: Pass all string input through the grammar.

This commit is contained in:
Jason Volk 2020-06-23 00:54:48 -07:00
parent 9dd9875611
commit ea1c0dcae7

View file

@ -2779,7 +2779,7 @@ ircd::json::stringify(mutable_buffer &buf,
char *const start(begin(buf)); char *const start(begin(buf));
assert(!surrounds(member.first, '"')); assert(!surrounds(member.first, '"'));
consume(buf, copy(buf, '"')); consume(buf, copy(buf, '"'));
consume(buf, copy(buf, member.first)); printer(buf, printer.name, member.first);
consume(buf, copy(buf, "\":"_sv)); consume(buf, copy(buf, "\":"_sv));
stringify(buf, member.second); stringify(buf, member.second);
const string_view ret const string_view ret
@ -3389,12 +3389,6 @@ ircd::json::stringify(mutable_buffer &buf,
v.string, v.len v.string, v.len
}; };
if(v.serial)
{
consume(buf, copy(buf, sv));
break;
}
printer(buf, printer.string, sv); printer(buf, printer.string, sv);
break; break;
} }
@ -3532,9 +3526,6 @@ ircd::json::serialized(const value &v)
if(!v.string) if(!v.string)
return size(empty_string); return size(empty_string);
if(v.serial)
return v.len;
thread_local char test_buffer[value::max_string_size]; thread_local char test_buffer[value::max_string_size];
const string_view sv{v.string, v.len}; const string_view sv{v.string, v.len};
mutable_buffer buf{test_buffer}; mutable_buffer buf{test_buffer};