From nobody Fri Nov 1 00:01:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+107141+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1690013916634446.62020020259854; Sat, 22 Jul 2023 01:18:36 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=gVr1cuueN6+eHt5cyIcaAoNEq2O9572BUyRfWJCEK+Y=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:X-Received:X-Received:X-MS-Exchange-Authentication-Results:Received-SPF:X-Received:X-Received:X-Received:X-Received:From:To:CC:Subject:Date:Message-ID:MIME-Version:X-NV-OnPremToCloud:X-EOPAttributedMessage:X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic:X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck:X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam-Message-Info:X-OriginatorOrg:X-MS-Exchange-CrossTenant-OriginalArrivalTime:X-MS-Exchange-CrossTenant-Network-Message-Id:X-MS-Exchange-CrossTenant-Id:X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp:X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs:X-MS-Exchange-CrossTenant-FromEntityHeader:X-MS-Exchange-Transport-CrossTenantHeadersStamped:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:X-Gm-Message-State:Content-Transfer-Encoding:Content-Type; s=20140610; t=1690013916; v=1; b=XdNa3YaYvAYhhRHAYqOtSyUCnXAjCI3JhQVAF+BYhYwWchM0u+JI4CdR3zFyHpZNShiyzCp5 8gjOlZkPUy+Puni3Bi2yErGi1jTy1/dSqHdzbZgHwqmsItlcbJtfGBdO/5A6c4ZFL7af3Lra9rT T2JIFPp9RGBtFQIKUnkD1w/U= X-Received: by 127.0.0.2 with SMTP id hPJvYY1788612xvmlB6gG199; Sat, 22 Jul 2023 01:18:36 -0700 X-Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.50]) by mx.groups.io with SMTP id smtpd.web10.1819.1690013915802825445 for ; Sat, 22 Jul 2023 01:18:35 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LWUBChWLe/s6QbQvFammaq847ryn4DisFF0y4yo+znH7mAEs8lW+WjiLEslyCXp718WOY27C4OMwZE3HfkIRdLm+1RSMidLKILzm6ABbHkywFWz4PVhwp0uaafF3/4HUGpVnsqZlO4Bb6C0JcESOOmc7liVuGl8BwT0GapfQ2FapIzyPFNKuYIZ3NUIO4SZv2Yn1QFIrY7AWc9KewTtTirEHS81m3jl/yRfyO5ZVivZKR0iJnKsjKf+bQkJctoZWBLuBE8/EyWRnc37mV27XRixHIi5sVD+3M50ODqpC9GnLJPEgYUMMMGYC1aPimhgy+lnH9omz7p/2KZm3fsLfOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+jjJ1nRBjl/5sm3R4OFBmKEcgCFehK0MqJyzbThpKzs=; b=SK+8XpyC9qXbfiaHZfNftATtwRCJvznkstjcFCejA1lRUL18xUT0Y8AIfWnkWXngYw7Aq/a+Hlo379NNZg4rFFciyRihc0VMT3gKsP5Txpz1/fDqLh+RJv42+Coz41OByM28xB4G7vfF7V6XZljjfQfs0+O+PzzV7abl076SYVNRc+xTvXMUMVDTBznc+PjSkkOsLbxTOFWKVrfiZmECzWa5cxsJ6e/JNgZWQ4LgD6STIJe/3aJloG+x0nmdZ8C8X3QLqAs6Jnh1HygEHakQMgjlSOUJGuel/eAZ03BBoIWOsHbMQn4ITiNuiZuUPZL5ak61xDBElOk9By6r6gw+Pw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none X-Received: from BN9PR03CA0621.namprd03.prod.outlook.com (2603:10b6:408:106::26) by DM4PR12MB5248.namprd12.prod.outlook.com (2603:10b6:5:39c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Sat, 22 Jul 2023 08:18:33 +0000 X-Received: from BN8NAM11FT016.eop-nam11.prod.protection.outlook.com (2603:10b6:408:106:cafe::28) by BN9PR03CA0621.outlook.office365.com (2603:10b6:408:106::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.30 via Frontend Transport; Sat, 22 Jul 2023 08:18:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+107141+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C X-Received: from mail.nvidia.com (216.228.117.160) by BN8NAM11FT016.mail.protection.outlook.com (10.13.176.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28 via Frontend Transport; Sat, 22 Jul 2023 08:18:33 +0000 X-Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Sat, 22 Jul 2023 01:18:27 -0700 X-Received: from rnnvmail204.nvidia.com (10.129.68.6) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sat, 22 Jul 2023 01:18:27 -0700 X-Received: from NV-CL38DL3.nvidia.com (10.127.8.13) by mail.nvidia.com (10.129.68.6) with Microsoft SMTP Server id 15.2.986.37 via Frontend Transport; Sat, 22 Jul 2023 01:18:26 -0700 From: "Nickle Wang via groups.io" To: CC: Abner Chang , Igor Kulchytskyy , "Nick Ramirez" Subject: [edk2-devel] [PATCH] RedfishPkg/RedfishRestExDxe: return HTTP status code to caller. Date: Sat, 22 Jul 2023 16:18:26 +0800 Message-ID: <20230722081826.301-1-nicklew@nvidia.com> MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT016:EE_|DM4PR12MB5248:EE_ X-MS-Office365-Filtering-Correlation-Id: e3d4d543-f619-4b1b-6240-08db8a8c3d86 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: MK7asYqklX2E5Zdx6i8j0KZATOnNlA6lBIKXzBJP/pYhh+mebAxfKWMJFGyIFtjE+O4x9JnOAaQIoe+xBq6fMegbr2KRBkXNVGWnTh2R43LoWkJdiRM0xC8cSqA3cQ5WSsDC4J2r59VC7fpfgK9wWxdGSkQs6koU+tXCeKiw2S88RwaARplfFERNARfTDMNum2GySsAwUGmn9x34XiRyiyjfwsI4mzUUkijFXDHGyLTQ87oMdjdHfoKQ7LFi10HbaAv9sSkqr46hjDs32s3tCyyatzmX9nKQQ4HZjoeSzm6b8LpdtpXJ7qyrysmNfSYfHFxJOj1np5UlHssMFFPMu5AZMSwHVMiikJW671nWSKAMn9PSOHCgxl6pbaR1v3l8w8lRezlaYX9oFEPgbotCAUqpWlDdldEjh15h0JUoK6rIbFOKiKp2Qg3z4geA0SM4wEi861olVAa8tjSAYLoW76EYqNe6/MhqSVGv/Qd9XBtItMTfZSuJQNYrDRokzJrfk0Eem7I22Ai7cPR1yGKnEHPGNFZS5GQPGJXrewwSOQJTUsY4w7VhNPXkznxehlbRN89skYZUnmbmoBepPN/rTuZxEa+zCuuiihuEMeOJt3Xm/Gwftd1u2dPOMx3LkHHvxnceuuxjJx4jWYboQh7ZOfke9uKTuHnv3If5ElDWNl33aVIZ6msAoC7s/YN8glO1GrhAnU9h76ytMwZcot83g7RoUU9A/Fr3IZmDMYpgKrl5DgZfvZc8IFoQkia+0+oc X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2023 08:18:33.3297 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e3d4d543-f619-4b1b-6240-08db8a8c3d86 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT016.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5248 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 Reply-To: devel@edk2.groups.io,nicklew@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: L4eQHmK3mPCF8QqyTT12gWDGx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1690013917187100002 Content-Type: text/plain; charset="utf-8" Return unsupported HTTP status code to caller so caller can handle HTTP error status code. Current implementation only return EFI error to caller. Without knowing the HTTP status code, caller has trouble to handle HTTP request failure. Signed-off-by: Nickle Wang Cc: Abner Chang Cc: Igor Kulchytskyy Cc: Nick Ramirez Reviewed-by: Abner Chang Reviewed-by: Igor Kulchytskyy --- .../RedfishRestExDxe/RedfishRestExProtocol.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c b/RedfishP= kg/RedfishRestExDxe/RedfishRestExProtocol.c index 90973619f2bc..f11cee8542fb 100644 --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c @@ -320,6 +320,18 @@ ReSendRequest:; DEBUG ((DEBUG_ERROR, "This HTTP Status is not handled!\n")); DumpHttpStatusCode (DEBUG_REDFISH_NETWORK, ResponseData->Response.Stat= usCode); Status =3D EFI_UNSUPPORTED; + + // + // Deliver status code back to caller so caller can handle it. + // + ResponseMessage->Data.Response =3D AllocateZeroPool (sizeof (EFI_HTTP_= RESPONSE_DATA)); + if (ResponseMessage->Data.Response =3D=3D NULL) { + Status =3D EFI_OUT_OF_RESOURCES; + goto ON_EXIT; + } + + ResponseMessage->Data.Response->StatusCode =3D ResponseData->Response.= StatusCode; + goto ON_EXIT; } =20 @@ -444,11 +456,6 @@ ON_EXIT: } =20 if (EFI_ERROR (Status)) { - if (ResponseMessage->Data.Response !=3D NULL) { - FreePool (ResponseMessage->Data.Response); - ResponseMessage->Data.Response =3D NULL; - } - if (ResponseMessage->Body !=3D NULL) { FreePool (ResponseMessage->Body); ResponseMessage->Body =3D NULL; --=20 2.17.1 -=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 (#107141): https://edk2.groups.io/g/devel/message/107141 Mute This Topic: https://groups.io/mt/100292372/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-