From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4F32FA00C5; Tue, 26 Jul 2022 20:25:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 33DDC40E25; Tue, 26 Jul 2022 20:25:09 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 14ECA40E0F for ; Tue, 26 Jul 2022 20:25:08 +0200 (CEST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH v2 02/13] telemetry: fix escaping of invalid json characters Date: Tue, 26 Jul 2022 20:25:05 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D871F0@smartserver.smartshare.dk> In-Reply-To: <20220725163543.875775-3-bruce.richardson@intel.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH v2 02/13] telemetry: fix escaping of invalid json characters Thread-Index: AdigRKaxqMWmO7LwTWS93xV79dXVDgA2Csfg References: <20220623164245.561371-1-bruce.richardson@intel.com> <20220725163543.875775-1-bruce.richardson@intel.com> <20220725163543.875775-3-bruce.richardson@intel.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Bruce Richardson" , Cc: "Ciara Power" , "Keith Wiles" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > From: Bruce Richardson [mailto:bruce.richardson@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 >=20 > 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. >=20 > To handle this, we replace the snprintf call with a separate string > copying and encapsulation routine which checks each character as it > copies it to the final array. >=20 > [1] https://www.rfc-editor.org/rfc/rfc8259.txt >=20 > Fixes: 6dd571fd07c3 ("telemetry: introduce new functionality") > Bugzilla ID: 1037 >=20 > Signed-off-by: Bruce Richardson > --- Patchwork didn't pick up my reply to the 00/13 of the series, so I'll = try again here... Series-Acked-by: Morten Br=F8rup