From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.58]) by mx.groups.io with SMTP id smtpd.web11.53272.1675690756803557995 for ; Mon, 06 Feb 2023 05:39:17 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=KyzD7JH+; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.92.58, mailfrom: nicklew@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N10m5Q8kRihWjquWe0F0ADLcpa324omFvpyHhOOXNTROpBGkd8Kf3kwvSktWa3xsTlKe9E0pBGUT/7bSM6do33Ihk5eZneXeNqsC6SWSndp6JATWSstLNqZDINr0/g6JSvucSOeYU4weQHvu+XRIDf6Gf7AxNVviqeld3zEAw7kRtpUsR3OPZFI737YJqUV7JPFd/qxmfNdpn82bZRxXfZ96GwsIAfz5XgBYxhVpF7JO/wsgfRv8QOmBIvHHhr7+4YA6Qt77LE38LkOtxztpdcl7nzyfluC8YgQ4lFLwN/YzWnHMVViIEwkpinCVMNEtDu5eMr4JOyqZh3AxnMJHzg== 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=5IZjLviBISPWVznhM6CuQZfMYTTZM+JP3OAAU15UIqg=; b=Z49X5JtBNtYTTBAAAGvJxZND1FAPATZqTcw6Pwd+8EZ+PRm067f/DAF64W/yB1Znhkh6809qZa5/NNgdHreVdBURwZO0jawCsp5+WlwjgWtzp/hEVrWYogSbZ0WhrVQQCjopFzB9GXk2xZQUZ2LOn4fjVesyWMX0OsjzhVSi/n9U5dYFq8dSDsXUS/mW88U4EXB0cg64OhK394/2c1EXRCB8BhOFipMgI7LTXxEop+rdz5xNnmxbNi041HPXHLga6ZlwoZuqk7kF4I5tnIy4GwyA1olDgTFS7ZpiFuULs9Y13UzZhE5KRUY662tWjmqALH962EINg8yuHPs7N+Yq4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5IZjLviBISPWVznhM6CuQZfMYTTZM+JP3OAAU15UIqg=; b=KyzD7JH+9cC2KsSnpH5YsFHK51+NQzXReAuQmcxLMovhU+FxCpVa9ZrkDoZNCSVBhb5A9TcAHvVjC/hpamVYetkOlFmLy5NosBUwEscNE+Q8cTTd/hOJ769QNHHsi1iQP77XkeWYjn7/W/3DcEvd7ZcjmCVcjCCYVmS0MpJhAXYdjRoJaGlaT4u8Pg6DmAbVlUXV2U/k9oaj/H+x2k1Bg/JKssG2SLouyEK7Swm3tsJ5b6qlD/qdK3YZpG6CsnIc9GmM1y4zbjoOIAWlx+VxmJjRvFHcEAPz2UudjqGa8T3l3QYkM/OBMOCeiUoqddopboL7rEmOORPnIF1bWAHElA== Received: from MW4PR12MB7031.namprd12.prod.outlook.com (2603:10b6:303:1ef::6) by SN7PR12MB8060.namprd12.prod.outlook.com (2603:10b6:806:343::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34; Mon, 6 Feb 2023 13:39:14 +0000 Received: from MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::6b34:f6ce:b778:4075]) by MW4PR12MB7031.namprd12.prod.outlook.com ([fe80::6b34:f6ce:b778:4075%6]) with mapi id 15.20.6064.034; Mon, 6 Feb 2023 13:39:14 +0000 From: "Nickle Wang" To: "Chang, Abner" , "devel@edk2.groups.io" , "igork@ami.com" Subject: Re: [PATCH] RedfishPkg: RedfishRestExDxe: PCD introduced to disable chunked reguest Thread-Topic: [PATCH] RedfishPkg: RedfishRestExDxe: PCD introduced to disable chunked reguest Thread-Index: AQHZNmbN8RqcSVRMHUesVmEbiJwDmK6+8ENAgAMDQxA= Date: Mon, 6 Feb 2023 13:39:14 +0000 Message-ID: References: <1675274302-14788-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-04T16:00:40Z; 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=387e3230-c179-46d7-8496-7f4891c7fada; 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=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MW4PR12MB7031:EE_|SN7PR12MB8060:EE_ x-ms-office365-filtering-correlation-id: c6675cde-98f3-4f2f-8a49-08db0847896b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7VV/mL3mOYdiiEFACIn4W+Pg0ND2WV6JP/ndCbPFcofS7UMWNtANKa/4kRnDkogtf4JpIWtPRJMBwLdpGppCPBMQxYR+Hh39WCiFmMciz3pkTc0TeDZQHHGB/racarOZUrxg/LU5ER1yEfTmJ9gzMRE/5CIX5rHUu0sAN2R/aBxp+o+6qCR1v3Nsxpwqbz/vAZjQySBQ7qQdRLBqif0mxizEpf3jfHjrR/6joW+EQ6jAIkgVu9V4s8LZFfLjnTDjDM1TByRMp6nyPeVXxAWkw+s/SOLTxtmc3ABbYclqDM2az2E36ggPDFSUeZjR5DEdwtWKb2lATK1Ym+/Z4Nxr5DPZSIwjGeSQGsT2wY1N0dgviRix9sJB6IIb5ClRpjIrnZVQJFPf/2JP/wAuYU8t2RG1zODB24aXpwXEaFJsIQWVxNQBdCdU2yJt62a265hUpMCttR23cPEmptkp0nMgArTRfn4FJO9zUNvS3z7CW5jOD5w3KFiJO+9wyM4wQxXTDGTPdj9RBtw0MxVqhK0JWux3O0B6C6itwIgduIxYlbfogI2kT5sU03badDRtfBrzamo6Mni2Qs1OJQcQUp0KNiDM1Y5aqh7KcJifemJVhJar9xaMcu248gsjRS5AiQPalH4hy1KSJHkcT79UvwmlQnkY9b6cfd/+58JqKTmlNlMiglykoOk61gzIU6JluN2WO4AFMn7wKZqUWITJ5/PW1w== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR12MB7031.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(6029001)(4636009)(346002)(136003)(396003)(376002)(366004)(39860400002)(451199018)(40140700001)(2906002)(71200400001)(7696005)(966005)(9686003)(26005)(6506007)(53546011)(66476007)(186003)(52536014)(8676002)(66946007)(8936002)(66556008)(66446008)(64756008)(76116006)(41300700001)(45080400002)(478600001)(316002)(5660300002)(110136005)(30864003)(122000001)(38070700005)(38100700002)(86362001)(33656002)(55016003)(83380400001)(66899018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?JTKzXSf7979frjQ93hfjnG8FG6Zj0s6wI4N46vhUcxcj0fH0dPMguIydc0Do?= =?us-ascii?Q?Wh9z5B0qsUYS8XDgCzH6b2up8d+EHgiRNHs3Q+bKgUlJjdTujNarhoQ7pkUK?= =?us-ascii?Q?eLiwdYTq67ci4ZDDkDWClU4YvOOahB/KhCYV6HJ3dZVY+BtKjhj9npyutpdz?= =?us-ascii?Q?YFwII3Ua09RLhvdAWDrv7nhMY3YJoi7uXrgGbQcjyrdlE9MfzqDCpNk6WwYY?= =?us-ascii?Q?/OGdcUE0p9znGOJBgfjwgDfhc135+Lc1nFDC3WEMDmujtRDZN9dESs62BVlv?= =?us-ascii?Q?hzTaDzUrbLiFGGq7Mz5fvlge+2o4Sh8vWD8QR5oSm8TcrK0ApTDdSBlZpnVQ?= =?us-ascii?Q?ksWPp9pnD9iLz/qYmQx8qbGMXCBeQ2eNvgBsB01ZQ0ag62XfnuViCzc/coar?= =?us-ascii?Q?PYAVStf4YSVdGDZkGx0TLELC5RxpQgBhIVZdn2WrTPRWu3ex1+yyIB6tXuHR?= =?us-ascii?Q?2QdIZBZvdDKzffy+Y046WBWfInhH9qNs2q3rlepxk1wtknHsRdR/+X+cAq9r?= =?us-ascii?Q?sV5wwS6vqq2RZ/jUh39MtWRTUbIOquiMKdl4C1kUgzU3FhuCtlx9Z9ShY6Be?= =?us-ascii?Q?pWTC6HNLo1KRo06cdQCD5u92CtAvKBq4mLayxMjjrEsvf4HxQjNnfp8Q0H0M?= =?us-ascii?Q?26x9c/IFsELEzTefhH4rSc1wcaBoXyp6X1fLiwyy7xx+ac3/iX4UkuU6hEVK?= =?us-ascii?Q?m4Qfe/KSHOuWlud3c0hcmYFgkHkkhOZwrsEdv+vy13nJ2bXoihMeAqNmYYhk?= =?us-ascii?Q?+s4937I173USxZ5E1qJKOfnkB/HyVlWZAsojvPxEtioBL+I8dI+B0WEcxhi+?= =?us-ascii?Q?F9vC8cdTmXGDm8MiLyeDmKMAfyqeFR7Ta36ww0D6cZmAyn4PKDH7/rmOWDP2?= =?us-ascii?Q?0avhmueSHDswxdKx/JwODabpiBN5odkYLhJJ164LUju861IqQ6za2ZCpvvwR?= =?us-ascii?Q?vch/1KvEuVJTK+6GdpkIge/ZTCjWys/8vSoa02dEaRttSYdS8ppPLEAxkqUj?= =?us-ascii?Q?NnIpVlhKqO6hVQg9vyMp2bQwgNsYnxcZKFG2vHpstw84aO5r3mfAJmlVCqIR?= =?us-ascii?Q?rcH+eDuxb+HTlcZaaUKti/3wMRcfKFjgdHzmRUN1b3KoB9F6W6x6kEb6BBun?= =?us-ascii?Q?MKRCT/is4EuGDk/b1w66fJMaG6+go/AurMP14QXsN+yz7vJuGGceV++wOEFo?= =?us-ascii?Q?YH9QRiq7DyQ+wZDNRbnzddyDZvlZ7pWfxv/EUYD155RVDTXfpAMT7hbfOQgo?= =?us-ascii?Q?ebriP1g7eIQO3hMb9q1GmHlRgGh/66hrZi052uUskkIHUNiNDYZ6ZAct/MpG?= =?us-ascii?Q?zKRu/8gPwdIUnY8SYY3I1/Dly1g0VdbEVehihVg039m82qYiWFbzYtde+yM/?= =?us-ascii?Q?X89rfpIubFF6M864JPAQYcT7UftAzSHzUSZmuu15+o6O+8COwF5UG40UMVTs?= =?us-ascii?Q?Opbd2d6/oUR5EKBw3CDOyhGXRx5uTj0gXVgPvT/CyrHCBuoAEpbNPr528Bim?= =?us-ascii?Q?gY5BpWuL4Vne/4pS6Iv3IBGRPN3ZFD8ZDQV4oRB1egB5V3dv/wyiGsOdxB2W?= =?us-ascii?Q?1xi1dYFoNeOoSJKazd9+ukt/ULitVEbX0s30a5py?= 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: c6675cde-98f3-4f2f-8a49-08db0847896b X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Feb 2023 13:39:14.3658 (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: iutncvt/ngSSFZ6XBP+6bbvpTlbEZvsAFmxxbrMU8k2JgyIAMmMFTVhNnXJDn+H1pG1RSFDdzfsyPQ61anKGTg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8060 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Igor, It seems to me that AMI copyrights header is missing in these files. Could = you please check this? Thanks, Nickle -----Original Message----- From: Chang, Abner =20 Sent: Sunday, February 5, 2023 12:01 AM To: devel@edk2.groups.io; igork@ami.com Cc: Nickle Wang Subject: RE: [PATCH] RedfishPkg: RedfishRestExDxe: PCD introduced to disabl= e chunked reguest External email: Use caution opening links or attachments [AMD Official Use Only - General] Hi Igor, thanks for doing this. The code which is wrapped by "if (FixedPcdGetBool(PcdRedfishRestExChunkRequ= estMode)" has the different tab spaces. Also, some new lines have the trail= ing spaces. I update Nickle's email address for this mail thread temporarily, you can c= orrect his email address in commit message later. Another comment in line below, > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Igor=20 > Kulchytskyy via groups.io > Sent: Thursday, February 2, 2023 1:59 AM > To: devel@edk2.groups.io > Cc: Igor Kulchytskyy ; Chang, Abner=20 > ; Nickle Wang > Subject: [edk2-devel] [PATCH] RedfishPkg: RedfishRestExDxe: PCD=20 > introduced to disable chunked reguest > > Caution: This message originated from an External Source. Use proper=20 > caution when opening attachments, clicking links, or responding. > > > BIOS should be able to work with different BMC implementation. > Some BMC does not support the chunked requests. > So, this feature should be optional. > Build time PCD was introduced to enable/disable chunked request. > > Cc: Abner Chang > Cc: Nickle Wang > Signed-off-by: Igor Kulchytskyy > --- > RedfishPkg/RedfishPkg.dec | 6 + > RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf | 1 + > RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c | 158=20 > +++++++++++----- > ---- > 3 files changed, 96 insertions(+), 69 deletions(-) > > diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec=20 > index d2b189b..4b4706b 100644 > --- a/RedfishPkg/RedfishPkg.dec > +++ b/RedfishPkg/RedfishPkg.dec > @@ -97,3 +97,9 @@ > # 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|FALSE|B > O > + OLEAN|0x00001003 > + > \ No newline at end of file > diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf > b/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf > index 75437b0..26ce167 100644 > --- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf > +++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf > @@ -57,6 +57,7 @@ > > [Pcd] > =20 > gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceAccessModeInBand > ## CONSUMES > + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExChunkRequestMode ## > CONSUMES > > [UserExtensions.TianoCore."ExtraFiles"] > RedfishRestExDxeExtra.uni > diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c > b/RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c > index 4b61fc0..22dc5e1 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,78 +96,96 @@ RedfishRestExSendReceive ( > DEBUG ((DEBUG_INFO, "\nRedfishRestExSendReceive():\n")); > DEBUG ((DEBUG_INFO, "*** Perform HTTP Request Method - %d, URL:=20 > %s\n", > RequestMessage->Data.Request->Method, RequestMessage->Data.Request- > >Url)); > > - // > - // Add header "Expect" to server, only for URL write. > - // > - Status =3D RedfishHttpAddExpectation (This, RequestMessage,=20 > &PreservedRequestHeaders, &ItsWrite); > - if (EFI_ERROR (Status)) { > - return Status; > - } > - > - if (ItsWrite =3D=3D TRUE) { > - if (RequestMessage->BodyLength > HTTP_IO_MAX_SEND_PAYLOAD) { > + if(FixedPcdGetBool(PcdRedfishRestExChunkRequestMode)){ > // > - // Send chunked transfer. > + // Add header "Expect" to server, only for URL write. > // > - SendChunkProcess++; > - CopyMem ((VOID *)&ChunkTransferRequestMessage, (VOID > *)RequestMessage, sizeof (EFI_HTTP_MESSAGE)); > - } else { > - SendNonChunkProcess++; > - } > + 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++; > + } > + } > } > - > + > ReSendRequest:; > - // > - // Send out the request to REST service. > - // > - if (ItsWrite =3D=3D TRUE) { > - // > - // This is write to URI > - // > - if (SendChunkProcess > HttpIoSendChunkNone) { > + > + if(FixedPcdGetBool(PcdRedfishRestExChunkRequestMode)){ The behavior of Expect-Continue for chunk transfer should be: Send the Expe= ct header first then check if the return HTTP status is Payload Too Large o= r not. Due to sending Expect is not only for checking the payload too large= error and we don't have the code yet for checking HTTP error status yet, w= e would need another PCD for adding Expect header. Adding the Expect header= according to PcdRedfishRestExAddingExpect in RedfishHttpAddExpectation(). = With this, we can separate the logic of adding Expect and the Chunk Transfe= r. Later we can have the code to check HTTP return status for Expect and ha= ve the further actions (such as the error handler for the PUT on read only = resource URI). Thanks Abner > // > - // This is chunk transfer for writing large payload. > - // Send request header first and then handle the > - // following request message body using chunk transfer. > + // Send the chunked request to REST service. > // > - do { > - Status =3D HttpIoSendChunkedTransfer ( > + if (ItsWrite =3D=3D TRUE) { > + // > + // This is write to URI > + // > + 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 a= nd then > + // handle the following request message body using chunk trans= fer. > + // > + Status =3D HttpIoSendRequest ( > + &(Instance->HttpIo), > + (SendNonChunkProcess =3D=3D HttpIoSendNonChunkConte= nt) ? NULL : > RequestMessage->Data.Request, > + (SendNonChunkProcess =3D=3D HttpIoSendNonChunkConte= nt) ? 0 : > RequestMessage->HeaderCount, > + (SendNonChunkProcess =3D=3D HttpIoSendNonChunkConte= nt) ? NULL : > RequestMessage->Headers, > + (SendNonChunkProcess =3D=3D > HttpIoSendNonChunkHeaderZeroContent) ? 0 : RequestMessage->BodyLength, > + (SendNonChunkProcess =3D=3D > HttpIoSendNonChunkHeaderZeroContent) ? NULL : RequestMessage->Body > + ); > + } > + } else { > + // > + // This is read from URI. > + // > + Status =3D HttpIoSendRequest ( > &(Instance->HttpIo), > - &SendChunkProcess, > - &ChunkTransferRequestMessage > + RequestMessage->Data.Request, > + RequestMessage->HeaderCount, > + RequestMessage->Headers, > + RequestMessage->BodyLength, > + RequestMessage->Body > ); > - if (EFI_ERROR (Status)) { > - goto ON_EXIT; > - } > - } while (SendChunkProcess =3D=3D HttpIoSendChunkContent || > SendChunkProcess =3D=3D HttpIoSendChunkEndChunk); > - } else { > + } > + } > + 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 normal request to 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 { > - // > - // This is read from URI. > - // > - Status =3D HttpIoSendRequest ( > - &(Instance->HttpIo), > - RequestMessage->Data.Request, > - RequestMessage->HeaderCount, > - RequestMessage->Headers, > - RequestMessage->BodyLength, > - RequestMessage->Body > - ); > } > - > + > if (EFI_ERROR (Status)) { > goto ON_EXIT; > } > @@ -213,7 +233,7 @@ ReSendRequest:; > // > // Restore the headers if it ever changed in RedfishHttpAddExpectation= (). > // > - if (RequestMessage->Headers !=3D PreservedRequestHeaders) { > + if (FixedPcdGetBool(PcdRedfishRestExChunkRequestMode) && > + RequestMessage->Headers !=3D PreservedRequestHeaders) { > FreePool (RequestMessage->Headers); > RequestMessage->Headers =3D PreservedRequestHeaders; // Restore=20 > headers before we adding "Expect". > RequestMessage->HeaderCount--; // Minus one head= er count for > "Expect". > @@ -223,8 +243,8 @@ 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=20 > + chunks.", ResponseData->Response.StatusCode)); > SendChunkProcess++; > goto ReSendRequest; > } > @@ -240,14 +260,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) &&=20 > + SendChunkProcess =3D=3D HttpIoSendChunkHeaderZeroContent) { > DEBUG ((DEBUG_INFO, "Bad request may caused by zero length=20 > 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) &&=20 > + SendChunkProcess =3D=3D HttpIoSendChunkHeaderZeroContent) { > // > // We get HTTP_STATUS_100_CONTINUE to send the body using chunk=20 > transfer. > // > @@ -256,7 +276,7 @@ ReSendRequest:; > goto ReSendRequest; > } > > - if (SendNonChunkProcess =3D=3D HttpIoSendNonChunkHeaderZeroContent) = { > + if (FixedPcdGetBool(PcdRedfishRestExChunkRequestMode) &&=20 > + SendNonChunkProcess =3D=3D HttpIoSendNonChunkHeaderZeroContent) { > DEBUG ((DEBUG_INFO, "HTTP_STATUS_100_CONTINUE for non chunk=20 > transfer...\n")); > SendNonChunkProcess++; > goto ReSendRequest; > -- > 2.6.1.windows.1 > -The information contained in this message may be confidential and=20 > proprietary to American Megatrends (AMI). This communication is=20 > intended to be read only by the individual or entity to whom it is=20 > addressed or by their designee. If the reader of this message is not=20 > the intended recipient, you are on notice that any distribution of=20 > this message, in any form, is strictly prohibited. Please promptly=20 > 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. > > >=20 >