Re: [PATCH v2 02/13] telemetry: fix escaping of invalid json characters

2022-07-27 Thread Bruce Richardson
On Wed, Jul 27, 2022 at 09:13:18AM +0800, fengchengwen wrote: > On 2022/7/26 0:35, Bruce Richardson wrote: > > For string values returned from telemetry, escape any values that cannot > > normally appear in a json string. According to the json spec[1], the > > characters than need to be handled are

Re: [PATCH v2 02/13] telemetry: fix escaping of invalid json characters

2022-07-27 Thread Bruce Richardson
On Tue, Jul 26, 2022 at 08:25:05PM +0200, Morten Brørup wrote: > > From: Bruce Richardson [mailto:bruce.richard...@intel.com] > > Sent: Monday, 25 July 2022 18.36 > > To: dev@dpdk.org > > Cc: Bruce Richardson; Ciara Power; Keith Wiles > > Subject: [PATCH v2 02/

RE: [PATCH v2 02/13] telemetry: fix escaping of invalid json characters

2022-07-26 Thread Morten Brørup
> From: Bruce Richardson [mailto:bruce.richard...@intel.com] > Sent: Monday, 25 July 2022 18.36 > To: dev@dpdk.org > Cc: Bruce Richardson; Ciara Power; Keith Wiles > Subject: [PATCH v2 02/13] telemetry: fix escaping of invalid json > characters > > For string values

[PATCH v2 02/13] telemetry: fix escaping of invalid json characters

2022-07-25 Thread Bruce Richardson
For string values returned from telemetry, escape any values that cannot normally appear in a json string. According to the json spec[1], the characters than need to be handled are control chars (char value < 0x20) and '"' and '\' characters. To handle this, we replace the snprintf call with a sep