accept newlines in sharkd json request
Summary
(follow up of https://ask.wireshark.org/question/25581/invalid-json-request-to-tshark/)
sharkd doesn't support json with newlines in it. To be fair, it is mentioned here: https://wiki.wireshark.org/Development/sharkd#request-syntax but that seems overly restrictive. Same for the newline at the end, I was wondering why my perfectly valid json wouldn't work. These restrictions make sense in cli mode but when you start it in daemon mode it is a pain.
Steps to reproduce
launch sharkd unix:/tmp/sharkd.sock
cat contrib/info.json | socat UNIX-CONNECT:/tmp/sharkd.sock -
with info.json
{
"jsonrpc": "2.0"
, "id": 1
, "method":"info"
}
What is the current bug behavior?
I get {"jsonrpc":"2.0","id":0,"error": {"code":-32600,"message":"Invalid JSON(2)"}}
What is the expected correct behavior?
No error, just process the json. One can match the closing brace } with the first brace { to know the end. (What you should see instead)
Sample capture file
(If possible attach a sample capture file showing this issue)
Build information
wireshark 3.6.1