Anthony Liguori wrote:
The main advantage of not relying on whitespace terminated messages is
that it gives us the ability to pretty print the protocol on the wire.
For instance, I'd rather read:
{ "execute": "info",
"id" : "32",
"arguments": ["cpus"]}
I agree. It's not even expensive.
It's still useful for parsers to easily find the end before parsing.
So declare the JSON terminator to be "}\n" or "}\r\n". That shouldn't
occur anywhere inside a pretty printed structure. The internal
closing braces are all followed by a comma.