From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.81]) by mx.groups.io with SMTP id smtpd.web10.1541.1675900641523322231 for ; Wed, 08 Feb 2023 15:57:22 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@ami.com header.s=selector1 header.b=eXUsqCco; spf=pass (domain: ami.com, ip: 40.107.220.81, mailfrom: igork@ami.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RHwRjIPWgqE9AJfs6X/NwFTXFK67CtLx8ksmh65wp+UGppsvGjkGfW1xiAEvS6WAPsG6OdPTNGNHRIe0mC2Jxq0Dz72VueyyEDqU+cDWgBbxieACgH5TS0JJHSNAFpQwmp/WhlfK674AKLiwP5ZTk3FiAiM+MUJjRpd4HdSs/nv/7uFhTvhuvEyTlEJ63V63SWG1AXxxTG5Hil/6Bamb3sk3I7tmCIWodGXUyK4QXKvph2GIOjSR3YkWXU2jymfXk13M2nowTeyY6g6tDhorvfOqGofgrKqcgWvcZiLsxxoQOTFO2XuEiuf+Sit0IoQPDRibZs4yy3aCJSHySfSnIw== 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=6e+O+J0/25c4b+ENNTeuroykrCbv4b+XYavo3j7lX8Y=; b=IeDS9bX++XFhTkR/3+U4Dg2hkaBBpHrgQsDkhKdlOzMyncJbedZIaAxI8ZLtP05V1GyssLD4wQO2uA7JD4c0xNlZ+LptkOat+6tp7mjy002pTGvDQ2lyVA0pRkhCw1zrsyhb28cknaGBYcoKQ7Fzs1KUr0D9cLmYYybOZbslLo1o5pZYTtrykK8r/FG7QUSrBllcr/OhwgzeGXKbLnQULZ2+i8jWQC+Qgr45LJgDX9ykqyEEXykg/PdeD/lvv2tVmVoUQhODGN/gCpI7aG/ekITf/cxttRVTm2PALKelIQfkRHO/KSUACdFwIAVHAq4rpR1QDnRa5iDwo8pUtFQ/gA== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ami.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6e+O+J0/25c4b+ENNTeuroykrCbv4b+XYavo3j7lX8Y=; b=eXUsqCcoB5fie23CO4ATNqbvlyhuy+FWYNPrfhWpLT82h3XwIA8kj21ABlz/JbN0ywEq3V+YRI2E2o7NUhaqrZJZ8LexxtCOcQS+Glm0fa8AIynU1oBP84SXJouVbxiIPesawMe3uPto9s2Mhc2EpJIM8Y5NgswHmoseIT9wfIs= Received: from BLAPR10MB5185.namprd10.prod.outlook.com (2603:10b6:208:328::16) by SN4PR10MB5607.namprd10.prod.outlook.com (2603:10b6:806:20a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.7; Wed, 8 Feb 2023 23:57:17 +0000 Received: from BLAPR10MB5185.namprd10.prod.outlook.com ([fe80::3318:8f42:7036:dbbf]) by BLAPR10MB5185.namprd10.prod.outlook.com ([fe80::3318:8f42:7036:dbbf%7]) with mapi id 15.20.6086.017; Wed, 8 Feb 2023 23:57:16 +0000 From: "Igor Kulchytskyy" To: "Chang, Abner" , "devel@edk2.groups.io" CC: Nickle Wang Subject: Re: [PATCH V2 RESEND] RedfishPkg: RedfishRestExDxe: Two PCDs for controlling the requests Thread-Topic: [EXTERNAL] RE: [PATCH V2 RESEND] RedfishPkg: RedfishRestExDxe: Two PCDs for controlling the requests Thread-Index: AQHZO+H7SzEi3/eXhEyBzL/FbdXLca7FhhYggAAufXA= Date: Wed, 8 Feb 2023 23:57:16 +0000 Message-ID: References: <1675876965-19952-1-git-send-email-igork@ami.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-02-08T21:13:14Z; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=93416d1f-5d91-4c66-80e2-1418f7183b62; MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=ami.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BLAPR10MB5185:EE_|SN4PR10MB5607:EE_ x-ms-office365-filtering-correlation-id: 4e190f44-7f4f-4ca4-ab2e-08db0a3034ed x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0QdNg8MTmzleAvOcIs5UEVbW1mEZaMvbtRTCCQF6X5vuVYkGGmeo8XI/1uJv+5G4TmEM81r015wenUSZuB475ESEjNHZdan1j6mcf8xBY3h0hk/+VIfhyMinDdl4c0VHkyfsdJVV43aIQYBbaI12sj+t7y4qNl+lY7enjYxRwGoqbdpVq6GDQ0am8xpMvW+oHSlHRADXLgNBTSSckWf3whIvX+2G7UnStDig6GZUS30gRBnZhnQjta49o1ou8zzrn8tfHkZ/zbZt2K8kwbOy6zkyZwNPWRIFSqbx/GVgQ0I5339xFFhFZAO4d8SWX0+Kkp9Dsa/Zl28LCuL4aKpkisoovzGXikNV1re0tQV9XoS12YEGN5Q1ynQd/ChT+5/c8/q3yvxVXXKULNOufJO8hnzI6qyFe37rUEEDVZSZjp54Ke3shS4Wew5V4USxxlibaZ+rEXnkdXAcikx7Ww5Q/0DCA9U1kYGEBhzgE7jYQOJ7PdqUgcEffEInvxbDn+rD1uECB+YTY2MO3ep58dYet5XDa4iEQSBeymCHdAA7pGoqHbPt47U7aoQ+hBzFiojtkdW1pEciyULJfRnzeC/a32pPW6F3Ctouz8vNiTNdUkqgQoIx9pHIkY44dhzEiaRflC4zm+Ep/CkEKejVBLeoC9GME3B3gSzHoBgDKx/esT55QAwOzSyXulor3NLYKyQnmD6wjNvGxGi44wlegCbLtw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BLAPR10MB5185.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(6029001)(4636009)(136003)(366004)(39850400004)(346002)(396003)(376002)(451199018)(40140700001)(33656002)(4326008)(83380400001)(316002)(110136005)(53546011)(478600001)(6506007)(7696005)(26005)(186003)(9686003)(71200400001)(5660300002)(8936002)(52536014)(38070700005)(86362001)(2906002)(76116006)(66946007)(55016003)(30864003)(8676002)(64756008)(66446008)(66556008)(66476007)(38100700002)(122000001)(41300700001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?hN+JQkTaoS/X0x8TM7HoyxswlCDmS1dwBaT0TYPmtYYWCawf77YT2s0V20ey?= =?us-ascii?Q?msySfJpsXI3eYPf1fFZJTiOz7Z5AtOOBDlLP2O/ULqv5NzpoOySP7/VPZRAw?= =?us-ascii?Q?+/1ywx2LRmIjfQFRZwd//JPY/KkcJ1VkxnWwvjH7ZDvx9uprxOx2wzqov5Xy?= =?us-ascii?Q?GVksuZffzyj8eEPZYlXBDyRZCplvhSCYm84tR7dakiR1lNMKhsucHZep0W66?= =?us-ascii?Q?3HP+DP2p+Eq6+UyakvmLqrM2jg9OSmzSpyFAftJzaFBhXcKId6E5CFN/SIJ6?= =?us-ascii?Q?I6Zh2uB+AFj55VXy3vLIW4nRRIzIv3kmoE1sKm/oez2ZVzN7newwYxAEB3E7?= =?us-ascii?Q?7RYRRNnl1/b80wlFU7VA1SsrzLnc2HARbbJ2c+8D7BQd/0sr6CXH001Zz0+z?= =?us-ascii?Q?9e1x5W8zbvEz4nTU7DQtCpOrK9IshPqMxpV/O64/TW3nBIYRAUZ5qHEPuFd7?= =?us-ascii?Q?yX/tv7rI4aPbCMLEnp8WhAl5nwKgQfo1EjXF0Ci1IFX/PZMPVSGQBwvyel/Q?= =?us-ascii?Q?PUkIiDc6od1HYpYOFga0BnvM5jsWhkrzKJOeGUbb0gKExfZhyRshM47hkfxa?= =?us-ascii?Q?PQp/sgyCE1BrxYZtCqS67aGqU8ZkYr+pH8qVrBEfjyasC44KUXjg9Zzg9S/R?= =?us-ascii?Q?J/2+T5hHWJE2YudgTwXNv7i6ggb/7y51Ht2tcdZ/ZKiisV37Vu4wvS4fnPBb?= =?us-ascii?Q?4qNAa33o1KT7LkYicZ9ylFp7qp+ZMtC0Krf0OunJ5S7BmYoiDB0C69HDxZCI?= =?us-ascii?Q?pcH4mSzROtjnRErTAWgMlNyJIRZeLObCAGXIik7kM9owjlLW8Ps+0QbjvxFt?= =?us-ascii?Q?6xXAxtCt7ckkOKyRBGNnhhS7VbVHItnJfi4Ijnn10fH1pxrfx3vLKDxtjfG/?= =?us-ascii?Q?pFZEbWwpLCwuLRORHUvcEM4Hq/gkwQbequ2VqqLyoZIDr8gVPpXoZ6FhW9mT?= =?us-ascii?Q?m1QKZLPp8Dw6kCzigLS9+W1s/x5qHE2wiEB477Y60mdPFWKDMshSpjpGpFSA?= =?us-ascii?Q?3pMGOQLeED+o3J4QYw/YTjMRD6EZxpOi+vPOOCfjx5+2ZsdUZmeckY7QaSnW?= =?us-ascii?Q?m9+ESofKvpjeL0+CdIgnGidcmObZsekCM8EN7D7mkooDd+iBfaluUXq/+dzh?= =?us-ascii?Q?AtuWcB4mR8rpufwiAUwZzPIq2WbhbzqznwqFWLEZtfdLfmqo1wW3wJfY7eZm?= =?us-ascii?Q?dkx5QW6efcEIAOjxdeCdEQB320ZSnMRJLCciEYYPmudp90BH6txG6595Xols?= =?us-ascii?Q?8UBck7CcJ6970v7vxKMrzdn4bWGRU9kGJ9h+ycr4AeZavfoQh5hLIq2U8BDV?= =?us-ascii?Q?rMn9p1y6pOAqq+Rq0K3NrZnwTbhxKtulZVkt/DVYXciUhYRyAcFOAMWSo05R?= =?us-ascii?Q?6hfFcFXw+C8J60+QygZ+uq0nsrLSXlX4SNe1arcf4ou2tN3ejvtuGxbsSSR+?= =?us-ascii?Q?YRG28bHwZ8SAD46KHMX8P15H6ni0X2UVZ4kpPxoNJ7SAMReLZO5v/R8vgWHf?= =?us-ascii?Q?IqJHLGYqC8gooByOoUD+vxbfG1qMaaN29kM2M9Yi5oWSnq5+0PCFDqbtmZZZ?= =?us-ascii?Q?kN+mOahqEM0Lf2ensgI=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: 4e190f44-7f4f-4ca4-ab2e-08db0a3034ed X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Feb 2023 23:57:16.5131 (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: y4h6BkPxpuJs9O9rwwa0VfMxBwd3k6zuENu/rlkPE+H5kp0BdTFHh+QcAqWqymX8 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR10MB5607 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Abner, Thank you for your comments. See my comments on your comments below. Igor -----Original Message----- From: Chang, Abner Sent: Wednesday, February 8, 2023 4:13 PM To: Igor Kulchytskyy ; devel@edk2.groups.io Cc: Nickle Wang Subject: [EXTERNAL] RE: [PATCH V2 RESEND] RedfishPkg: RedfishRestExDxe: Two= PCDs for controlling the requests **CAUTION: The e-mail below is from an external source. Please exercise cau= tion before opening attachments, clicking links, or following guidance.** [AMD Official Use Only - General] Hi Igor, Few comments in below. > -----Original Message----- > From: Igor Kulchytskyy > Sent: Thursday, February 9, 2023 1:23 AM > To: devel@edk2.groups.io > Cc: Igor Kulchytskyy ; Chang, Abner > ; Nickle Wang > Subject: [PATCH V2 RESEND] RedfishPkg: RedfishRestExDxe: Two PCDs for > controlling the requests > > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. > > > Since BIOS should work with different BMC implementation chunked > requests as well as Expect header should be optional. > One PCD is used to enable/disable Expect header. > Another PCD is used to enable/disable chunked requests. > > Cc: Abner Chang > Cc: Nickle Wang > Signed-off-by: Igor Kulchytskyy > --- > RedfishPkg/RedfishPkg.dec | 10 ++ > RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf | 2 + > RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c | 23 ++-- > RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c | 140 > ++++++++++++---- > ---- > 4 files changed, 113 insertions(+), 62 deletions(-) > > diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec > index d2b189b..89ef32a 100644 > --- a/RedfishPkg/RedfishPkg.dec > +++ b/RedfishPkg/RedfishPkg.dec > @@ -97,3 +97,13 @@ > # protocol instance. > # > > gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDiscoverAccessModeInBand|FALSE| > BOOLEAN|0x00001002 > + # > + # This PCD indicates if the EFI REST EX sends chunk request to Redfish= service. > + # Default is set to non chunk mode. > + # > + > + > gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExChunkRequestMode|TRUE|BO > O > + LEAN|0x00001003 We can default set PcdRedfishRestExChunkRequestMode to FALSE. Igor: Agree. Just forgot to make it FALSE after I tested BIOS with Expect P= CD disabled and Chunked PCD enabled. > + # > + # This PCD indicates if the EFI REST EX adds Expect header to the > + POST, PATCH, > PUT requests to Redfish service. > + # Default is set to not add. > + # > + > + > gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExAddingExpect|FALSE|BOOLEA > + N|0x00001004 > diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf > b/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf > index 75437b0..29003ae 100644 > --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf > +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf > @@ -57,6 +57,8 @@ > > [Pcd] > > gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceAccessModeInBand > ## CONSUMES > + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExChunkRequestMode ## > CONSUMES > + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExAddingExpect ## > CONSUMES > > [UserExtensions.TianoCore."ExtraFiles"] > RedfishRestExDxeExtra.uni > diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c > b/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c > index 952e9d1..0da0d10 100644 > --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c > +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c > @@ -140,9 +140,6 @@ RedfishHttpAddExpectation ( > } > > *ItsWrite =3D FALSE; > - if (PreservedRequestHeaders !=3D NULL) { > - *PreservedRequestHeaders =3D RequestMessage->Headers; > - } > > if ((RequestMessage->Data.Request->Method !=3D HttpMethodPut) && > (RequestMessage->Data.Request->Method !=3D HttpMethodPost) && > (RequestMessage->Data.Request->Method !=3D HttpMethodPatch)) @@ - > 152,10 +149,20 @@ RedfishHttpAddExpectation ( > > *ItsWrite =3D TRUE; > > - NewHeaders =3D AllocateZeroPool ((RequestMessage->HeaderCount + 1) * > sizeof (EFI_HTTP_HEADER)); > - CopyMem ((VOID *)NewHeaders, (VOID *)RequestMessage->Headers, > RequestMessage->HeaderCount * sizeof (EFI_HTTP_HEADER)); > - HttpSetFieldNameAndValue (NewHeaders + RequestMessage->HeaderCount, > HTTP_HEADER_EXPECT, HTTP_EXPECT_100_CONTINUE); > - RequestMessage->HeaderCount++; > - RequestMessage->Headers =3D NewHeaders; > + // > + // Check PCD before adding Expect header // > + if(FixedPcdGetBool(PcdRedfishRestExAddingExpect)) { > + if (PreservedRequestHeaders !=3D NULL) { > + *PreservedRequestHeaders =3D RequestMessage->Headers; > + } > + > + NewHeaders =3D AllocateZeroPool ((RequestMessage->HeaderCount + 1) > + * > sizeof (EFI_HTTP_HEADER)); > + CopyMem ((VOID *)NewHeaders, (VOID *)RequestMessage->Headers, > RequestMessage->HeaderCount * sizeof (EFI_HTTP_HEADER)); > + HttpSetFieldNameAndValue (NewHeaders + > + RequestMessage->HeaderCount, > HTTP_HEADER_EXPECT, HTTP_EXPECT_100_CONTINUE); > + RequestMessage->HeaderCount++; > + RequestMessage->Headers =3D NewHeaders; } > + > return EFI_SUCCESS; > } > diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c > b/RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c > index 4b61fc0..fbd5e46 100644 > --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c > +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c > @@ -66,11 +66,13 @@ RedfishRestExSendReceive ( > HTTP_IO_SEND_NON_CHUNK_PROCESS SendNonChunkProcess; > EFI_HTTP_MESSAGE ChunkTransferRequestMessage; > > - Status =3D EFI_SUCCESS; > - ResponseData =3D NULL; > - IsGetChunkedTransfer =3D FALSE; > - SendChunkProcess =3D HttpIoSendChunkNone; > - SendNonChunkProcess =3D HttpIoSendNonChunkNone; > + Status =3D EFI_SUCCESS; > + ResponseData =3D NULL; > + IsGetChunkedTransfer =3D FALSE; > + SendChunkProcess =3D HttpIoSendChunkNone; > + SendNonChunkProcess =3D HttpIoSendNonChunkNone; > + ItsWrite =3D FALSE; > + PreservedRequestHeaders =3D NULL; > > // > // Validate the parameters > @@ -94,67 +96,85 @@ RedfishRestExSendReceive ( > DEBUG ((DEBUG_INFO, "\nRedfishRestExSendReceive():\n")); > DEBUG ((DEBUG_INFO, "*** Perform HTTP Request Method - %d, URL: > %s\n", > RequestMessage->Data.Request->Method, RequestMessage->Data.Request- > >Url)); > > - // > - // Add header "Expect" to server, only for URL write. > - // > - Status =3D RedfishHttpAddExpectation (This, RequestMessage, > &PreservedRequestHeaders, &ItsWrite); > - if (EFI_ERROR (Status)) { > - return Status; > - } > + if(FixedPcdGetBool(PcdRedfishRestExChunkRequestMode)){ Due to whether to add "Expect" header is managed by PcdRedfishRestExAddingE= xpect, so we can relocate the condition check for PcdRedfishRestExChunkRequ= estMode to be above "if (ItsWrite =3D=3D TRUE) {" in 8 lines later. With this, we can add code later to send the zero content payload with "Exp= ect" header and check the HTTP Status for the HTTP Chunk transfer or other = error cases. Igor: I'm not sure if it would help anyhow. We cannot use "Expect" without = chunked request. If I understand it correctly, the main point of "Expect" h= eader is to send just headers without body to see if the URI supported. But= if chunked request is disabled then we would send the whole request with t= he body anyway. So, there is no difference if we send it with or without "E= xpect" header. And another purpose of that RedfishHttpAddExpectation function, besides of = adding "Expect" header, is to figure out if it is POST, PATCH or PUT reques= t and set ItsWrite variable. But this variable also used only for the chunk= ed requests. So, I think, it is better to keep it under if(FixedPcdGetBool(= PcdRedfishRestExChunkRequestMode)) condition. What do you think? > + // > + // Add header "Expect" to server, only for URL write. > + // > + Status =3D RedfishHttpAddExpectation (This, RequestMessage, > &PreservedRequestHeaders, &ItsWrite); > + if (EFI_ERROR (Status)) { > + return Status; > + } > > - if (ItsWrite =3D=3D TRUE) { > - if (RequestMessage->BodyLength > HTTP_IO_MAX_SEND_PAYLOAD) { > - // > - // Send chunked transfer. > - // > - SendChunkProcess++; > - CopyMem ((VOID *)&ChunkTransferRequestMessage, (VOID > *)RequestMessage, sizeof (EFI_HTTP_MESSAGE)); > - } else { > - SendNonChunkProcess++; > + if (ItsWrite =3D=3D TRUE) { > + if (RequestMessage->BodyLength > HTTP_IO_MAX_SEND_PAYLOAD) { > + // > + // Send chunked transfer. > + // > + SendChunkProcess++; > + CopyMem ((VOID *)&ChunkTransferRequestMessage, (VOID > *)RequestMessage, sizeof (EFI_HTTP_MESSAGE)); > + } else { > + SendNonChunkProcess++; > + } > } > } > > ReSendRequest:; > - // > - // Send out the request to REST service. > - // > - if (ItsWrite =3D=3D TRUE) { > + > + if(FixedPcdGetBool(PcdRedfishRestExChunkRequestMode)){ > // > - // This is write to URI > + // Send the chunked request to REST service. > // > - if (SendChunkProcess > HttpIoSendChunkNone) { > + if (ItsWrite =3D=3D TRUE) { > // > - // This is chunk transfer for writing large payload. > - // Send request header first and then handle the > - // following request message body using chunk transfer. > + // This is write to URI > // > - do { > - Status =3D HttpIoSendChunkedTransfer ( > + if (SendChunkProcess > HttpIoSendChunkNone) { > + // > + // This is chunk transfer for writing large payload. > + // Send request header first and then handle the > + // following request message body using chunk transfer. > + // > + do { > + Status =3D HttpIoSendChunkedTransfer ( > + &(Instance->HttpIo), > + &SendChunkProcess, > + &ChunkTransferRequestMessage > + ); > + if (EFI_ERROR (Status)) { > + goto ON_EXIT; > + } > + } while (SendChunkProcess =3D=3D HttpIoSendChunkContent || > SendChunkProcess =3D=3D HttpIoSendChunkEndChunk); > + } else { > + // > + // This is the non-chunk transfer, send request header first and= then > + // handle the following request message body using chunk transfe= r. > + // > + Status =3D HttpIoSendRequest ( > &(Instance->HttpIo), > - &SendChunkProcess, > - &ChunkTransferRequestMessage > + (SendNonChunkProcess =3D=3D HttpIoSendNonChunkContent= ) ? NULL : > RequestMessage->Data.Request, > + (SendNonChunkProcess =3D=3D HttpIoSendNonChunkContent= ) ? 0 : > RequestMessage->HeaderCount, > + (SendNonChunkProcess =3D=3D HttpIoSendNonChunkContent= ) ? NULL : > RequestMessage->Headers, > + (SendNonChunkProcess =3D=3D > HttpIoSendNonChunkHeaderZeroContent) ? 0 : RequestMessage->BodyLength, > + (SendNonChunkProcess =3D=3D > + HttpIoSendNonChunkHeaderZeroContent) ? NULL : RequestMessage->Body > ); > - if (EFI_ERROR (Status)) { > - goto ON_EXIT; > - } > - } while (SendChunkProcess =3D=3D HttpIoSendChunkContent || > SendChunkProcess =3D=3D HttpIoSendChunkEndChunk); > + } > } else { > // > - // This is the non-chunk transfer, send request header first and t= hen > - // handle the following request message body using chunk transfer. > + // This is read from URI. > // > Status =3D HttpIoSendRequest ( > &(Instance->HttpIo), > - (SendNonChunkProcess =3D=3D HttpIoSendNonChunkContent) = ? NULL : > RequestMessage->Data.Request, > - (SendNonChunkProcess =3D=3D HttpIoSendNonChunkContent) = ? 0 : > RequestMessage->HeaderCount, > - (SendNonChunkProcess =3D=3D HttpIoSendNonChunkContent) = ? NULL : > RequestMessage->Headers, > - (SendNonChunkProcess =3D=3D HttpIoSendNonChunkHeaderZer= oContent) ? > 0 : RequestMessage->BodyLength, > - (SendNonChunkProcess =3D=3D HttpIoSendNonChunkHeaderZer= oContent) ? > NULL : RequestMessage->Body > + RequestMessage->Data.Request, > + RequestMessage->HeaderCount, > + RequestMessage->Headers, > + RequestMessage->BodyLength, > + RequestMessage->Body > ); > } > - } else { > + } > + else{ Please have "else" at the same line with above closed curly bracket and hav= e a space between "else" and "{" Igor: My mistake. Fixed. Thanks Abner > // > - // This is read from URI. > + // This is normal request to URI. > // > Status =3D HttpIoSendRequest ( > &(Instance->HttpIo), > @@ -213,7 +233,7 @@ ReSendRequest:; > // > // Restore the headers if it ever changed in RedfishHttpAddExpectation= (). > // > - if (RequestMessage->Headers !=3D PreservedRequestHeaders) { > + if (FixedPcdGetBool(PcdRedfishRestExAddingExpect) && > + RequestMessage->Headers !=3D PreservedRequestHeaders) { > FreePool (RequestMessage->Headers); > RequestMessage->Headers =3D PreservedRequestHeaders; // Restore > headers before we adding "Expect". > RequestMessage->HeaderCount--; // Minus one head= er count for > "Expect". > @@ -223,11 +243,23 @@ ReSendRequest:; > if (ResponseData->Response.StatusCode =3D=3D HTTP_STATUS_200_OK) { > DEBUG ((DEBUG_INFO, "HTTP_STATUS_200_OK\n")); > > - if (SendChunkProcess =3D=3D HttpIoSendChunkHeaderZeroContent) { > - DEBUG ((DEBUG_INFO, "This is chunk transfer, start to send all chu= nks.")); > + if (FixedPcdGetBool(PcdRedfishRestExChunkRequestMode) && > SendChunkProcess =3D=3D HttpIoSendChunkHeaderZeroContent) { > + DEBUG ((DEBUG_INFO, "This is chunk transfer, start to send all > + chunks.", ResponseData->Response.StatusCode)); > SendChunkProcess++; > goto ReSendRequest; > } > + } else if (ResponseData->Response.StatusCode =3D=3D > HTTP_STATUS_204_NO_CONTENT) { > + DEBUG ((DEBUG_INFO, "HTTP_STATUS_204_NO_CONTENT\n")); > + > + if (FixedPcdGetBool(PcdRedfishRestExChunkRequestMode) && > SendChunkProcess =3D=3D HttpIoSendChunkHeaderZeroContent) { > + DEBUG ((DEBUG_INFO, "This is chunk transfer, start to send all > + chunks.", > ResponseData->Response.StatusCode)); > + SendChunkProcess ++; > + goto ReSendRequest; > + } > + } else if (ResponseData->Response.StatusCode =3D=3D > HTTP_STATUS_201_CREATED) { > + DEBUG ((DEBUG_INFO, "HTTP_STATUS_201_CREATED\n")); } else if > + (ResponseData->Response.StatusCode =3D=3D HTTP_STATUS_202_ACCEPTED) { > + DEBUG ((DEBUG_INFO, "HTTP_STATUS_202_ACCEPTED\n")); > } else if (ResponseData->Response.StatusCode =3D=3D > HTTP_STATUS_413_REQUEST_ENTITY_TOO_LARGE) { > DEBUG ((DEBUG_INFO, > "HTTP_STATUS_413_REQUEST_ENTITY_TOO_LARGE\n")); > > @@ -240,14 +272,14 @@ ReSendRequest:; > goto ON_EXIT; > } else if (ResponseData->Response.StatusCode =3D=3D > HTTP_STATUS_400_BAD_REQUEST) { > DEBUG ((DEBUG_INFO, "HTTP_STATUS_400_BAD_REQUEST\n")); > - if (SendChunkProcess =3D=3D HttpIoSendChunkHeaderZeroContent) { > + if (FixedPcdGetBool(PcdRedfishRestExChunkRequestMode) && > + SendChunkProcess =3D=3D HttpIoSendChunkHeaderZeroContent) { > DEBUG ((DEBUG_INFO, "Bad request may caused by zero length > chunk. Try to send all chunks...\n")); > SendChunkProcess++; > goto ReSendRequest; > } > } else if (ResponseData->Response.StatusCode =3D=3D > HTTP_STATUS_100_CONTINUE) { > DEBUG ((DEBUG_INFO, "HTTP_STATUS_100_CONTINUE\n")); > - if (SendChunkProcess =3D=3D HttpIoSendChunkHeaderZeroContent) { > + if (FixedPcdGetBool(PcdRedfishRestExChunkRequestMode) && > + SendChunkProcess =3D=3D HttpIoSendChunkHeaderZeroContent) { > // > // We get HTTP_STATUS_100_CONTINUE to send the body using chunk > transfer. > // > @@ -256,7 +288,7 @@ ReSendRequest:; > goto ReSendRequest; > } > > - if (SendNonChunkProcess =3D=3D HttpIoSendNonChunkHeaderZeroContent) = { > + if (FixedPcdGetBool(PcdRedfishRestExChunkRequestMode) && > + SendNonChunkProcess =3D=3D HttpIoSendNonChunkHeaderZeroContent) { > DEBUG ((DEBUG_INFO, "HTTP_STATUS_100_CONTINUE for non chunk > transfer...\n")); > SendNonChunkProcess++; > goto ReSendRequest; > @@ -394,7 +426,7 @@ ReSendRequest:; > TotalReceivedSize +=3D ResponseData->BodyLength; > } > > - DEBUG ((DEBUG_INFO, "Total of lengh of Response :%d\n", > TotalReceivedSize)); > + DEBUG ((DEBUG_INFO, "Total of length of Response :%d\n", > + TotalReceivedSize)); > } > > DEBUG ((DEBUG_INFO, "RedfishRestExSendReceive()- EFI_STATUS: %r\n", > Status)); > -- > 2.6.1.windows.1 > -The information contained in this message may be confidential and > proprietary 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 designee. If the reader of this message is not > the intended recipient, you are on notice that any distribution of > this message, in any form, is strictly prohibited. Please promptly > notify the sender by reply e-mail or by telephone at 770-246-8600, and th= en delete or destroy all copies of the transmission. -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= .