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 D9BB8940F7D for ; Mon, 24 Jul 2023 02:06:18 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=HvDvwD5su6zVsbniCrKfuUlZnfrJx0RqC8ma6E8/5uA=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:X-Received:X-Received:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:X-MS-Has-Attach:X-MS-TNEF-Correlator: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-ms-exchange-antispam-messagedata-chunkcount:x-ms-exchange-antispam-messagedata-0:MIME-Version:X-OriginatorOrg:X-MS-Exchange-CrossTenant-AuthAs:X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-Network-Message-Id:X-MS-Exchange-CrossTenant-originalarrivaltime:X-MS-Exchange-CrossTenant-fromentityheader:X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype:X-MS-Exchange-CrossTenant-userprincipalname:X-MS-Exchange-Transport-CrossTenantHeadersStamped:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubsc ribe-Post:List-Unsubscribe:X-Gm-Message-State:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1690164377; v=1; b=uVIOJ0bfW4E+jx6knNLN4OTKAApAHLXRoVx8Ea+lZheNiZ6sVZvxA/2GI8d7D8ReHfdG4QDG iJskJixAWcGMM9iET4TMmSQq/uOL5kDEVKFEPTSDCorEveyDbJL4QX+My3MSNBzA4rIg60DdAeN 67f9Yed1LxwpqgV9V3Dz13W8= X-Received: by 127.0.0.2 with SMTP id 3H8xYY7687511xUWNr8rgOVC; Sun, 23 Jul 2023 19:06:17 -0700 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.41]) by mx.groups.io with SMTP id smtpd.web11.39365.1690164376948117978 for ; Sun, 23 Jul 2023 19:06:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JAzpZCbrL1j3wSqB+JAbjB5xARkep9gz59Wcz9SNHJJGskcXcK0GEM68YqcwrV/BLMolMoCnJ2l+Gcge9vCJ6rZmcOPwZYximWQBbbxAAd+TOSw5urBT1gEkw1CWhfaQFPjRfrJYrkJ+DQzyOVyuk0n1+yohSmcgPbixtgf0ECCiFnzB7zrgvTQkjCayitAP0DWJaW80L/vyZi9I2bwj9t3HO/46ARRhkej4SL8QW8Xdcc9HAFWcrrAUzSD4hXr46Bf/8Jp5NKUR8S2yn/XjM05cuxCLwclbjtE7h4xsf0MCUPbHt5N/MDu1dvgC15xaw7RLrK6mB9q6js5F8fjimw== 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=ZxJwBlJfqDxUVaXC5/cn61K7lV2TvMtOcYnW5LO56RM=; b=MZmBd01wlEiqGhCdMjTlDf7xonaszipfZoN93F4doCbelws1Rk+9PT+OuF3W3klFtvTF3vnG4CKpCkPXR26YXaYmCALUTtOAfmuFMQGUqpVM3BofxNlIW3uQktULphqnA683XcjSBAqXS7Ij/I8CyDY9ZPaFjc2SkEqqekEWtV7xKJOWsdO1vk6LPmFkbwsoTmVzrsLl8Kj5pZuYrzyEcws1iicQqAZPrO5Y0/nx1MfXasZpS83Lf65FVluk//TkUcXVzQ83cDgTacWVpsxGWvG/0Dtmal2rlB05CROQO2MfygzkaoYwlAcc8M50nGA9to6UFOTQzkNMFtqg2T6/tw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ami.com; dmarc=pass action=none header.from=ami.com; dkim=pass header.d=ami.com; arc=none X-Received: from BLAPR10MB5185.namprd10.prod.outlook.com (2603:10b6:208:328::16) by LV3PR10MB7745.namprd10.prod.outlook.com (2603:10b6:408:1b7::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.31; Mon, 24 Jul 2023 02:06:12 +0000 X-Received: from BLAPR10MB5185.namprd10.prod.outlook.com ([fe80::54b4:fe44:b9d9:ab6d]) by BLAPR10MB5185.namprd10.prod.outlook.com ([fe80::54b4:fe44:b9d9:ab6d%4]) with mapi id 15.20.6609.032; Mon, 24 Jul 2023 02:06:12 +0000 From: "Igor Kulchytskyy via groups.io" To: Nickle Wang , "devel@edk2.groups.io" CC: Abner Chang , Nick Ramirez Subject: Re: [edk2-devel] [PATCH] RedfishPkg/RedfishRestExDxe: return HTTP status code to caller. Thread-Topic: [EXTERNAL] [PATCH] RedfishPkg/RedfishRestExDxe: return HTTP status code to caller. Thread-Index: AQHZvHUeWGmxCQv5HEWR0/ahw8ZCu6/ILeQQ Date: Mon, 24 Jul 2023 02:06:12 +0000 Message-ID: References: <20230722081826.301-1-nicklew@nvidia.com> In-Reply-To: <20230722081826.301-1-nicklew@nvidia.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BLAPR10MB5185:EE_|LV3PR10MB7745:EE_ x-ms-office365-filtering-correlation-id: 670536e4-8d7a-455e-47c5-08db8bea8e18 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: gB7XwV6+wAWQPx4OYSHn3ZxYWvra2RunnYoL8yv4C6C134b156CUZIg0pnfdReR8zd7PYo+h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20SeHYHH6jwWkNL?= =?us-ascii?Q?4ZzfNwtCRYDWgXIGsLRGIjGWP4lXsQ0HTsnlZOPMFyZxEjgpscelZwmd5310?= =?us-ascii?Q?kyt+RsP3T9xDazDw4qLcXOzu3xDK+0ZosM3dRBK+oHruls4+e53gC5FaiKWN?= =?us-ascii?Q?8cgbeFInodEzipHZMKrdX2lruDOL1bIqdb967mLDnI80ufJSXSbEhuS/gg2/?= =?us-ascii?Q?qDekIy8SXupyzILySJFtvx6Hx8TGIalSFVIQAGShTAlUciFsa+NVlE9KDnQZ?= =?us-ascii?Q?SnjmPClbjlTj+BZN6NNzlqnXUW3zc6HU7UmBBCDFXFpCVEmjH1P7iYMSTNqF?= =?us-ascii?Q?Z1v/v/IQ1gwVTkRUyo4=3D?= MIME-Version: 1.0 X-OriginatorOrg: ami.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5185.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 670536e4-8d7a-455e-47c5-08db8bea8e18 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jul 2023 02:06:12.5236 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 27e97857-e15f-486c-b58e-86c2b3040f93 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: TH5x9aT/5XUQLkFFPjnKsJuP+K6IamKOV5ZK3ULpsf92BwrVKKoAFYmH3ANwR6Qq X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR10MB7745 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,igork@ami.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: WQvd12zo6TCeZWYEuxIBFGytx7686176AA= 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=20140610 header.b=uVIOJ0bf; dmarc=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 Reviewed-by: Igor Kulchytskyy -----Original Message----- From: Nickle Wang Sent: Saturday, July 22, 2023 4:18 AM To: devel@edk2.groups.io Cc: Abner Chang ; Igor Kulchytskyy ; Ni= ck Ramirez Subject: [EXTERNAL] [PATCH] RedfishPkg/RedfishRestExDxe: return HTTP status= code to caller. **CAUTION: The e-mail below is from an external source. Please exercise cau= tion before opening attachments, clicking links, or following guidance.** 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 --- .../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; } @@ -444,11 +456,6 @@ ON_EXIT: } 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; -- 2.17.1 -The information contained in this message may be confidential and propriet= ary to American Megatrends (AMI). This communication is intended to be read= only by the individual or entity to whom it is addressed or by their desig= nee. If the reader of this message is not the intended recipient, you are o= n notice that any distribution of this message, in any form, is strictly pr= ohibited. Please promptly notify the sender by reply e-mail or by telephone= at 770-246-8600, and then delete or destroy all copies of the transmission= . -=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 (#107154): https://edk2.groups.io/g/devel/message/107154 Mute This Topic: https://groups.io/mt/100292372/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-