From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 8061C7803CD for ; Tue, 26 Mar 2024 12:17:09 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=/bk+salJ4g2cEMfD8rC3H7j28phjUL7FHHYHNQsUmfk=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1711455428; v=1; b=EI90sIOA1vK3aatXwS1Vc2ZmaAq/eNfCOXzcHhvFOp/frEkwRTIO4Iz+fIvDSo0kKjSwHdH7 dBW5CYU0EDIjYM4YfLieO4M2M1DG4gbz3aIFivy5RjeOciQtQEy4H7XJFtS7VlAkq/2cdhXnsPZ QThSPsK9hj1A4Xfv4EYoOAQvceA0b15lRlnrAeO3t4jhegUM5L/0vAQctRLQH6bR4jl/6mqi9p7 5+Y6KOR+ZzUprCTlAlWv6wDHiXPly1pNEP/W1VVka6ANgRaMtOOy0SukPd+XlMUPz+9Ld2Je4iQ 4AdioKgH3kaFE3OoWwa9CtbfyW4bidAaRMRMBER0OzAdw== X-Received: by 127.0.0.2 with SMTP id 5uhfYY7687511xocfDVxgj2J; Tue, 26 Mar 2024 05:17:08 -0700 X-Received: from NAM02-BN1-obe.outbound.protection.outlook.com (NAM02-BN1-obe.outbound.protection.outlook.com [40.107.212.131]) by mx.groups.io with SMTP id smtpd.web11.7228.1711455427562858844 for ; Tue, 26 Mar 2024 05:17:07 -0700 X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) by IA0PR12MB8747.namprd12.prod.outlook.com (2603:10b6:208:48b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.32; Tue, 26 Mar 2024 12:17:04 +0000 X-Received: from MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::fef9:2c9c:21b5:6f50]) by MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::fef9:2c9c:21b5:6f50%2]) with mapi id 15.20.7409.031; Tue, 26 Mar 2024 12:17:04 +0000 From: "Nickle Wang via groups.io" To: Mike Maslenkin , "devel@edk2.groups.io" CC: Abner Chang , Igor Kulchytskyy Subject: Re: [edk2-devel] [edk2-redfish-client][RFC PATCH 2/3] RedfishClientPkg: fix the last field processing in GetRedpathNodeByIndex() Thread-Topic: [edk2-redfish-client][RFC PATCH 2/3] RedfishClientPkg: fix the last field processing in GetRedpathNodeByIndex() Thread-Index: AQHafRnNPEp+qfyWIkGW/IfHqf4dJ7FJ9MdQ Date: Tue, 26 Mar 2024 12:17:04 +0000 Message-ID: References: <20240323120050.53834-1-mike.maslenkin@gmail.com> <20240323120050.53834-3-mike.maslenkin@gmail.com> In-Reply-To: <20240323120050.53834-3-mike.maslenkin@gmail.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR12MB7031:EE_|IA0PR12MB8747:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: alfa+pAINpnQl8VQadymlrrhRutJVnpH93PlcwBhSaXax2Ah7vmyXE3JBJ1F5ukVhY8UTtHhCxtHn8ciCYyRdhfVG/p0g5C29NXOzx1nCtJbAwNiwKG5PFRArzUOhyWE0u/ITJPuJJyrUYIotyNSQ2k0ZDd8blhYKbTpSKjGJhYTxHc0QG3mNmB1LMwkeSYf/khG2c401kxoYS/2SRxPE4UDMgRG74U9+tgU9Bsow62tqqoVSBvmQ1TFA7sZhxdZ7tGeMvqJhnYaipOFarJ5eQRvvoA9AKvwi+zTYDPOQh8TaC1uMISyo8zs9hR1ai6q9+6+AmwtUnTZ9ynktKmajha58da2iLfVKhPARTMJDsob9sq7h15RoF+GGORwZOlYV/Y3mOjmJam8mZYSS3OGDhCfqg8EqyYaPwqFAe3G+TXar+z3NucHqYZ9aFmNEde6KKXUXQPgbdzkw+BzXaWjwlYU5zkJDFMNmHjXJtt/mxOGDJQyxDPpROeEGIzgvdftlnwXVRfDu1PxbpppilPo/goEXl80det4WWcOYchay082EFK7vfCgpb49HZ+A72KNsWvYJ66UChPqrDLQWM8+CNKogI4y6vFuX1GV87Kq63mcyO5pJdJyf6fHCOcpahWCtlgLVpn3FKMfDL7GlNiuyR2OnZLJAf0WO3LCEeVeZqQ= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?lkfBemLI0GMWA2xdZZG7kYdvQgthETMVY+RRRGJr4JUaOmiFjDsETgBliOzc?= =?us-ascii?Q?JZP43UituVo3c7IMfXRuMinwtuYbk4ZLCBtzQSd5wzOQAoojqkmPzYEZObHr?= =?us-ascii?Q?Jd1Ln9vwX3pcEHNILB+ayQOnivmHpi+pP+h7TRd6bSkBoa2t0RT5piTCGy5V?= =?us-ascii?Q?KIoeoOWFD8qD5GgZxiA6C/wzqCWqJbPXtjU2OWEtfHT469SGcnRYgOFBuwEu?= =?us-ascii?Q?lsJYWYf2+zxCGGjbCUNrt+a+co2Kbzjq2YEp0o5Na8smscR8ocLZyGUV5lK2?= =?us-ascii?Q?rW/e21urfbfmRqQHalCM7KrYB8C5LIfDO+VJNSThw/06pUcEfW6iyIxBoYHm?= =?us-ascii?Q?CsbAvjGrc2qzh3wpSExL6SMqI+A6gekkIUgnZVtISIXVY7U3zuJMVF0Lhgsl?= =?us-ascii?Q?B0ypR1kHRJ3lRCKHS9VKx8rPESuzY7QkUX3/gHqwevxSzU+evHja1HTySJl7?= =?us-ascii?Q?Ylh0EEOe3cadld7cFSrTyBXoZe/QmG9kVtcJo9fBv7jYMMQLkQj6ji5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VyNGYB/wr9O9phbFryw8?= =?us-ascii?Q?VX0pvFc0LNrp+1gdOpyynjqIM45Y99zbr4WGzaOouHFx/nPauEK+ybfnTM1U?= =?us-ascii?Q?rcxK060qxl+JE7QwPjilPPlAzMqeu9qabcj0jXdEGXp6NURwGbuUZ3iMONOB?= =?us-ascii?Q?MolCx+iebyY6Iu+fBAc=3D?= MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR12MB7031.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0bb6ccd7-3eea-4676-18dc-08dc4d8ea5f4 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2024 12:17:04.4306 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: fLKpT5JoLiKCeZXOEjsPW2/84/Uf2xDe63UAOe8a1/mli+Azza2tCFIQKP7TqxZEW3mAuI9NmSg0RYxg6o57LQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8747 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Tue, 26 Mar 2024 05:17:07 -0700 Reply-To: devel@edk2.groups.io,nicklew@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: FdzGuHpgfZKkQA2yZsCTuOVKx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=EI90sIOA; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Reviewed-by: Nickle Wang Regards, Nickle > -----Original Message----- > From: Mike Maslenkin > Sent: Saturday, March 23, 2024 8:01 PM > To: devel@edk2.groups.io > Cc: Mike Maslenkin ; Abner Chang > ; Igor Kulchytskyy ; Nickle Wang > > Subject: [edk2-redfish-client][RFC PATCH 2/3] RedfishClientPkg: fix the l= ast field > processing in GetRedpathNodeByIndex() >=20 > External email: Use caution opening links or attachments >=20 >=20 > After processing of nodes was fixed it was revealed that this function is= not > handling the last node correctly. The problem is that the end of node det= ected by > comparing to L'/', but usually ConfigLang and other properties do not hav= e > terminating separator (i.e '/'). So, before this patch the situation was = as below: >=20 > @Redfish.Settings found: /redfish/v1/Systems/system/Bios/Settings > GetNumberOfRedpathNodes: 6 > GetRedpathNodeByIndex[0]:/redfish/v1/Systems/system/Bios/Settings > GetRedpathNodeByIndex[1]:v1/Systems/system/Bios/Settings > GetRedpathNodeByIndex[2]:Systems/system/Bios/Settings > GetRedpathNodeByIndex[3]:system/Bios/Settings > GetRedpathNodeByIndex[4]:Bios/Settings > GetRedpathNodeByIndex[5]: >=20 > And after this patch the debug output is: >=20 > @Redfish.Settings found: /redfish/v1/Systems/system/Bios/Settings > GetNumberOfRedpathNodes: 6 > GetRedpathNodeByIndex[0]:/redfish/v1/Systems/system/Bios/Settings > GetRedpathNodeByIndex[1]:v1/Systems/system/Bios/Settings > GetRedpathNodeByIndex[2]:Systems/system/Bios/Settings > GetRedpathNodeByIndex[3]:system/Bios/Settings > GetRedpathNodeByIndex[4]:Bios/Settings > GetRedpathNodeByIndex[5]:Settings >=20 > The section with Index=3D5 is found and returned correctly. >=20 > Cc: Abner Chang > Cc: Igor Kulchytskyy > Cc: Nickle Wang > Signed-off-by: Mike Maslenkin > --- > .../RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib.c > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib.c > index 3231ef883379..b0a3b20a40bd 100644 > --- > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtility= Lib.c > +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUt > +++ ilityLib.c > @@ -1327,6 +1327,11 @@ GetRedpathNodeByIndex ( > StringIndex++; >=20 > } >=20 >=20 >=20 > + if (NumberNodes =3D=3D Index) { >=20 > + *EndOfNodePtr =3D NodeString + StringIndex - 1; >=20 > + return NodeStart; >=20 > + } >=20 > + >=20 > return (NULL); >=20 > } >=20 >=20 >=20 > -- > 2.32.0 (Apple Git-132) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117115): https://edk2.groups.io/g/devel/message/117115 Mute This Topic: https://groups.io/mt/105101992/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-