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 B3759AC12B5 for ; Sat, 23 Mar 2024 12:01:12 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=gVeZZQqqeqN3rLmHoIFmH9nhzeCkEsZBrBB7GC3gTBM=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1711195271; v=1; b=gdApbs3rCzb4odg3bY08Cpa43KafRbutL7Rsj5kj1DMX+h9U0SdWmZLgR+1fBXnoqowb968T 76vfEgLFPiyxpfcGekxKoQXrJP4EPwFBKI4gEnduyYtSnwlcTUQ0CVhoI4kO16RAUIagFTct+sU cH9kXSEoGGIOixhs9prLSCG15Bm9zpQKpmBTVZuxpQo69Zp3yOt0gABF5HYQnmDUk8kmNDbYA7V MgspLHpgZlVnYgv1BwmrYArZzjE9+gT/YfXUdNlnFqQB2MwMD0jG2ZqFDp/pD9ms7y6GORqO7Um Dmc4pBAFrC7jZSdwGY0YXu3aAg741sEkknCEOHbuEugPA== X-Received: by 127.0.0.2 with SMTP id BWdvYY7687511xuyDhQyPeb5; Sat, 23 Mar 2024 05:01:11 -0700 X-Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by mx.groups.io with SMTP id smtpd.web10.7319.1711195269611991867 for ; Sat, 23 Mar 2024 05:01:09 -0700 X-Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-513d599dbabso3856469e87.1 for ; Sat, 23 Mar 2024 05:01:09 -0700 (PDT) X-Gm-Message-State: ulcCFxSy7OZWzhzhgv8bXJCIx7686176AA= X-Google-Smtp-Source: AGHT+IEvHkdNDsPfvEfrjYEY1N41eqRWWPufujLyoj9SwUjnmZCpN5PkeHyfJbggMGAaqvJV4mzd7w== X-Received: by 2002:ac2:562d:0:b0:513:3214:ae03 with SMTP id b13-20020ac2562d000000b005133214ae03mr1148503lff.69.1711195267563; Sat, 23 Mar 2024 05:01:07 -0700 (PDT) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id u11-20020a05651220cb00b005131cf043f8sm266801lfr.155.2024.03.23.05.01.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 23 Mar 2024 05:01:07 -0700 (PDT) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: Mike Maslenkin , Abner Chang , Igor Kulchytskyy , Nickle Wang Subject: [edk2-devel] [edk2-redfish-client][RFC PATCH 2/3] RedfishClientPkg: fix the last field processing in GetRedpathNodeByIndex() Date: Sat, 23 Mar 2024 15:00:49 +0300 Message-Id: <20240323120050.53834-3-mike.maslenkin@gmail.com> In-Reply-To: <20240323120050.53834-1-mike.maslenkin@gmail.com> References: <20240323120050.53834-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 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: Sat, 23 Mar 2024 05:01:10 -0700 Reply-To: devel@edk2.groups.io,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: 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=gdApbs3r; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io 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 detected by comparing to L'/', but usually ConfigLang and other properties do not have terminating separator (i.e '/'). So, before this patch the situation was as below: @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]: And after this patch the debug output is: @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 The section with Index=3D5 is found and returned correctly. Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nickle Wang Signed-off-by: Mike Maslenkin --- .../RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatu= reUtilityLib.c b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishF= eatureUtilityLib.c index 3231ef883379..b0a3b20a40bd 100644 --- a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.c +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtili= tyLib.c @@ -1327,6 +1327,11 @@ GetRedpathNodeByIndex ( StringIndex++;=0D }=0D =0D + if (NumberNodes =3D=3D Index) {=0D + *EndOfNodePtr =3D NodeString + StringIndex - 1;=0D + return NodeStart;=0D + }=0D +=0D return (NULL);=0D }=0D =0D --=20 2.32.0 (Apple Git-132) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117067): https://edk2.groups.io/g/devel/message/117067 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] -=-=-=-=-=-=-=-=-=-=-=-