From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (NAM04-DM6-obe.outbound.protection.outlook.com [40.107.102.80]) by mx.groups.io with SMTP id smtpd.web10.5698.1675912806177180884 for ; Wed, 08 Feb 2023 19:20:06 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@ami.com header.s=selector1 header.b=SNGj3lN9; spf=pass (domain: ami.com, ip: 40.107.102.80, mailfrom: igork@ami.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LASoyfsVKR4hZ1dBuVET9vO8GRTIBnYo4wDv/npWJc1Ay81US4HUO+rbmEHdqIMdiwffYjr9ZUI2553moiH9gLcIVAz8AMg4Noi/l1T1bmTKErjYcPFBtJUoFd1UNlUR+8KO795KdTivKYl6CO2wQiyy8Lc6saYWOUE0/u/TnUF4+hBZ7pGyLeYIvf7IHu1X51+sYJBQYTUUgNbv5ahPRWWldUUlqEa0XKNA+7gpvMl4G0/jj6vScFbbMtHkN2CMK34a4l7024UDrx6j4BRG+gpZB4l4uQORsKjyUeD0HppirfMAf0ZD8H5XB6VELfH5nIck7Ubu3ERmgjSXxI2O9A== 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=Gvg3TGDF4zqB4l+yAtTgvKDEyO4jKFZ+JQivKv6pQC0=; b=ENnTeZjIQoLrErIz3DKtEBY+wgMG7Iavif+CYBp6jfpI3SoZLsrkRzoVVTKT4XZ3bYwGJIbNVChoUKkZOTi+EYYpKjR9hTGVncco2wcRkpv6UI+hnOim0E8/P7i/bF2AfJ5HIblynIME42H6KAQsyWJSi29Ha+mUxWqgSjblte7WxCELyw+R0Hd0b9mKv8QaCwFef8a0giGaC66lEXWswiOTSa5bX9zTu1dPinS4lbzuHLv0zdBcyalU2kRr3I9aI8Gz1xMBgeCfot2LTP72uWsmO7i+UNNaRKkHKQsxxoL+SEh78oNebMxiFg+0kho6WVRepT0BwESmDM4yNVoCnw== 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=Gvg3TGDF4zqB4l+yAtTgvKDEyO4jKFZ+JQivKv6pQC0=; b=SNGj3lN9K8PDjfM4JBy65cFJ8VCF3uXs+prwgEQLUMoW+r3RgnzzjBtVXIJydMOmjAV16jXYpAMzqCIk7QhMfe5pZ9gvp2Nk/g6/xo2VW9avhLUxmDp3NqA4KmjpxqxxZqBa/RkfWGdfc69+bnLoEizesXUwL2pECJUL24nrUb4= Received: from BLAPR10MB5185.namprd10.prod.outlook.com (2603:10b6:208:328::16) by PH0PR10MB4646.namprd10.prod.outlook.com (2603:10b6:510:38::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17; Thu, 9 Feb 2023 03:20:01 +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; Thu, 9 Feb 2023 03:20:00 +0000 From: "Igor Kulchytskyy" To: "devel@edk2.groups.io" CC: Igor Kulchytskyy , Abner Chang , Nickle Wang Subject: [PATCH V3] RedfishPkg: RedfishRestExDxe: Two PCDs for controlling the requests Thread-Topic: [PATCH V3] RedfishPkg: RedfishRestExDxe: Two PCDs for controlling the requests Thread-Index: AQHZPDVkBb5Lb0RnHEWzT1lZUOyaOQ== Date: Thu, 9 Feb 2023 03:20:00 +0000 Message-ID: <1675912789-10820-1-git-send-email-igork@ami.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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_|PH0PR10MB4646:EE_ x-ms-office365-filtering-correlation-id: 0a2001f6-d9cf-4db5-6f2e-08db0a4c8747 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Hw00VflUyNN+TLiuQaD/WhUXpzTzPrlEJsOUOhRlmRSoXvNyJ+cNL9i6CvXnNMHDD+SeEDp8d/ALR9V0KO1YuM/iiUjiAlpFrTyj9p+nu+IUp4omz517PXyopJCluD7S1dw01mk2GcNiR6aSun6JmLfsiPD5xmujEXFNbOgbFbwmt7euPS0aNcte0gtBjuvNIle8b30yE+kSJtg6fBeonYSUs2/8gJHJzI1lw9hA9RftP6wShfyJsJtMym6S7hIwUMjL3xP98JTcgh4y/S8ObcwopMcvQ/Fu/CX2+LSPO2Co+hkj09AqiVvSfxYTmqhcc7AhpN4n899v/ZOCssoy27fc6F0nuOnOsZkzDTjMQBdRPpWD6Fe4GVLVKFOOIiOkI3qiTHRi+UWlS7piLDAAuBQDsLVIgx86XQhOJ442An4o/uGXUIqbJQUydFEQ9Rc4LJ0AQS4/dFEu7hFNLdRJ+HD7hA6qAndJQODlYt1vT/4PmzgtV5IuMl1OQs6wnyG7AS0dTh9oKdfAzzR+nycdmM3Vju/XW4a2jKULFGC7K3H82VlzK6IwRFvjiqxfcCmwskQBxxHUE4INX+uTHOW77L/v/Qqem8frCL4Xd1YepJREXtDJvLamEgaMKF3fxxXgMDCP+aQHRRV9AcnVsLMTSCUmO27onZbJLrZ/78MzxjHajgy252vdQ+JW0+ZnO8YlCdp2xMj0xLYF3NQabZdqgQ== 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)(376002)(136003)(39850400004)(366004)(346002)(396003)(451199018)(316002)(83380400001)(54906003)(2906002)(36756003)(30864003)(8936002)(41300700001)(5660300002)(40140700001)(38070700005)(86362001)(38100700002)(122000001)(6916009)(76116006)(66946007)(8676002)(66556008)(91956017)(66476007)(66446008)(64756008)(4326008)(26005)(478600001)(186003)(6512007)(6486002)(6506007)(2616005)(71200400001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?ZRdlaV5FOJWId9T8E5nNu8jOkgDaXadwrUP21d9DMMOEqAofBCiOlyz93d?= =?iso-8859-1?Q?rbyRR76uWyLsccfP3DznF8+8kp5cPTqHEs7MmviB+Pkf7AKbs6YjBdWxGZ?= =?iso-8859-1?Q?jOIJdY8v6pIeIGchrKrBdGM5NehGQMY2LpOfvfxzNJ0uJs3vCIH7GlmsMH?= =?iso-8859-1?Q?NQt/7hZ5rxmaVJ9KGwHSfgDXbbpwO3WhX7W6uNPUBjhbnYm6hE9JaEG2Pz?= =?iso-8859-1?Q?jy7Z7ZDotLeovBvmzhTHZl+4gAF2sZON3DWPhH6aA5a1Fg5LDMM35booB6?= =?iso-8859-1?Q?ykf1PM/LQyGmoPqAFNS2HeXlnh8rJHzl2G9RYd+z8qEBCuJx1QZmZpnvYA?= =?iso-8859-1?Q?PYOk2mrERDe+VyhcZDUjE+uE5Z6Y0C8OgDgZJzJuS0I9m+QfYCCEm5KkxW?= =?iso-8859-1?Q?d5qDxMJ9LkJdiJ7E8qLnVSecgRLzrF2YbCMbE6mWhuLHa4iEqGHRbS07zU?= =?iso-8859-1?Q?5fPNGzWbju2qTrNCeieCtaiLrFK7ZdhmxxpdyJ+u29W0Pg0UfucMcx17Dh?= =?iso-8859-1?Q?E6+tQ3fXE8tGLuEEi0I4ZtGrx46v+V179C8iLx6OMWIevW6CyOIu4J42IJ?= =?iso-8859-1?Q?VKqx6eKe9WJZ8QeF+oceRJbVm6Huq5FKgHVzZ9XFQmhz1JqRirGnb7DePZ?= =?iso-8859-1?Q?0GTG071gEXld1UnRmjdZGtCD1xswHC57BPRxLovkD5KP5TqftpJKf8wimj?= =?iso-8859-1?Q?v6f+hwoH9R8c84pcanfng2kbwJ1zGPxfuAgWv5/cujQgo2pCKAsuZ1gurK?= =?iso-8859-1?Q?MFFayNvQdLkHfuGXAq8ZUByPgexXUIhIQoxYMOSp8z7uKg9I0ucUpwoMUV?= =?iso-8859-1?Q?VyAP+c4TGyCPvfv1EfKrsN2u4627wracIFcKINB4v9rA2y9OMFgYqXeGDF?= =?iso-8859-1?Q?wt/6WpNzjt3w4AOkqsxTXQ6owoczQlF5+VrDKlaUJMhTjkIveYlIE/1XMk?= =?iso-8859-1?Q?Nt0HefC+5mv2zwDZuX6VqXsfVNn+8NEv4wwhMc7EfVgalM08MQJj2ek6uK?= =?iso-8859-1?Q?KagehGBRTh7Fq5FaSjxJfSNX5UflKqlZY1nV6cNZKRUqXG1fEwGIzxAmId?= =?iso-8859-1?Q?uPzW7aQc9wa4IAxH6Dlv4T6Vq6wlSgkTNwf48dnQF4KPHssmCfbh4gSoLq?= =?iso-8859-1?Q?R+wTq02TKi3gJa6YHBJUqOzKqrr5EVOwlAoLPRDh3mwRf/glXcX6nI7A7/?= =?iso-8859-1?Q?D91LXrUYdx6rHKnxhWiUtxnjiTl+05tp3DH/nmZApO1c5PU0TvZ7FI0c6h?= =?iso-8859-1?Q?WhoB3IASv1QHC7AoKO8dCaFwP7s30Q4tzKtMCVqPEb3bXyfFLpfsKwq4vk?= =?iso-8859-1?Q?uEr/qfYUsqK/zBg1cKB0fLzyAfG4zKptYDTIABxXibxHBJ6RxAhex0MtMc?= =?iso-8859-1?Q?0VSPwX8kVat1/tHCWWwI4iji+PlOTgGbZ/PFkZ2RzeHfkxn3OpfkPY7op+?= =?iso-8859-1?Q?TQFtq4mend582Bb/j+iM8XAm7/uY/ph6Zym/DIdNR2VZIGrU6V8cyY04C+?= =?iso-8859-1?Q?QCfBTrTzqS5hoRP7Ce7vT3lzI4tXhKZujx2SK+k6Rhxjb0f5fVNilK2Gde?= =?iso-8859-1?Q?fJnkRf01mJiS3gH6I6b1Zlt614QLzEbTSvG7pFS2hikV37LxI88GYykE6w?= =?iso-8859-1?Q?Jla4WW4mklDHb/VsuZkOgGZs2xEy3tYWlg?= 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: 0a2001f6-d9cf-4db5-6f2e-08db0a4c8747 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Feb 2023 03:20:00.5830 (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: kqOyK3OGQvyhfifxph8lGh1MYOZW8uOih3MDi74Tgmu3Ouh3BKf34IRoPwBUY8U5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4646 Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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. Reviewed-by: Abner Chang 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 | 137 ++++++++++++----= ---- 4 files changed, 111 insertions(+), 61 deletions(-) diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec index d2b189b..bf48fdd 100644 --- a/RedfishPkg/RedfishPkg.dec +++ b/RedfishPkg/RedfishPkg.dec @@ -97,3 +97,13 @@ # protocol instance. # gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDiscoverAccessModeInBand|FALSE|BO= OLEAN|0x00001002 + # + # This PCD indicates if the EFI REST EX sends chunk request to Redfish s= ervice. + # Default is set to non chunk mode. + # + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExChunkRequestMode|FALSE|BOOL= EAN|0x00001003 + # + # 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|BOOLEAN|= 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 ## CONSU= MES + gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExAddingExpect ## CONSUMES [UserExtensions.TianoCore."ExtraFiles"] RedfishRestExDxeExtra.uni diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExImpl.c b/RedfishPkg/R= edfishRestExDxe/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) && (Reques= tMessage->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) * siz= eof (EFI_HTTP_HEADER)); - CopyMem ((VOID *)NewHeaders, (VOID *)RequestMessage->Headers, RequestMes= sage->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) * s= izeof (EFI_HTTP_HEADER)); + CopyMem ((VOID *)NewHeaders, (VOID *)RequestMessage->Headers, RequestM= essage->HeaderCount * sizeof (EFI_HTTP_HEADER)); + HttpSetFieldNameAndValue (NewHeaders + RequestMessage->HeaderCount, HT= TP_HEADER_EXPECT, HTTP_EXPECT_100_CONTINUE); + RequestMessage->HeaderCount++; + RequestMessage->Headers =3D NewHeaders; + } + return EFI_SUCCESS; } diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExProtocol.c b/RedfishP= kg/RedfishRestExDxe/RedfishRestExProtocol.c index 4b61fc0..21d5f47 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,84 @@ RedfishRestExSendReceive ( DEBUG ((DEBUG_INFO, "\nRedfishRestExSendReceive():\n")); DEBUG ((DEBUG_INFO, "*** Perform HTTP Request Method - %d, URL: %s\n", R= equestMessage->Data.Request->Method, RequestMessage->Data.Request->Url)); - // - // Add header "Expect" to server, only for URL write. - // - Status =3D RedfishHttpAddExpectation (This, RequestMessage, &PreservedRe= questHeaders, &ItsWrite); - if (EFI_ERROR (Status)) { - return Status; - } + if(FixedPcdGetBool(PcdRedfishRestExChunkRequestMode)){ + // + // Add header "Expect" to server, only for URL write. + // + Status =3D RedfishHttpAddExpectation (This, RequestMessage, &Preserved= RequestHeaders, &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 *)RequestMessag= e, 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 *)RequestMess= age, 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 || SendChu= nkProcess =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. + // + 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 HttpIoSendNonChunkHeaderZer= oContent) ? 0 : RequestMessage->BodyLength, + (SendNonChunkProcess =3D=3D HttpIoSendNonChunkHeaderZer= oContent) ? NULL : RequestMessage->Body ); - if (EFI_ERROR (Status)) { - goto ON_EXIT; - } - } while (SendChunkProcess =3D=3D HttpIoSendChunkContent || SendChunk= Process =3D=3D HttpIoSendChunkEndChunk); + } } else { // - // This is the non-chunk transfer, send request header first and the= n - // 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 HttpIoSendNonChunkHeaderZeroC= ontent) ? 0 : RequestMessage->BodyLength, - (SendNonChunkProcess =3D=3D HttpIoSendNonChunkHeaderZeroC= ontent) ? NULL : RequestMessage->Body + RequestMessage->Data.Request, + RequestMessage->HeaderCount, + RequestMessage->Headers, + RequestMessage->BodyLength, + RequestMessage->Body ); } } else { // - // This is read from URI. + // This is normal request to URI. // Status =3D HttpIoSendRequest ( &(Instance->HttpIo), @@ -213,7 +232,7 @@ ReSendRequest:; // // Restore the headers if it ever changed in RedfishHttpAddExpectation()= . // - if (RequestMessage->Headers !=3D PreservedRequestHeaders) { + if (FixedPcdGetBool(PcdRedfishRestExAddingExpect) && RequestMessage->Hea= ders !=3D PreservedRequestHeaders) { FreePool (RequestMessage->Headers); RequestMessage->Headers =3D PreservedRequestHeaders; // Restore header= s before we adding "Expect". RequestMessage->HeaderCount--; // Minus one header= count for "Expect". @@ -223,11 +242,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 chunk= s.")); + if (FixedPcdGetBool(PcdRedfishRestExChunkRequestMode) && SendChunkProc= ess =3D=3D HttpIoSendChunkHeaderZeroContent) { + DEBUG ((DEBUG_INFO, "This is chunk transfer, start to send all chunk= s.", ResponseData->Response.StatusCode)); SendChunkProcess++; goto ReSendRequest; } + } else if (ResponseData->Response.StatusCode =3D=3D HTTP_STATUS_204_NO_C= ONTENT) { + DEBUG ((DEBUG_INFO, "HTTP_STATUS_204_NO_CONTENT\n")); + + if (FixedPcdGetBool(PcdRedfishRestExChunkRequestMode) && SendChunkProc= ess =3D=3D HttpIoSendChunkHeaderZeroContent) { + DEBUG ((DEBUG_INFO, "This is chunk transfer, start to send all chunk= s.", ResponseData->Response.StatusCode)); + SendChunkProcess ++; + goto ReSendRequest; + } + } else if (ResponseData->Response.StatusCode =3D=3D HTTP_STATUS_201_CREA= TED) { + DEBUG ((DEBUG_INFO, "HTTP_STATUS_201_CREATED\n")); + } else if (ResponseData->Response.StatusCode =3D=3D HTTP_STATUS_202_ACCE= PTED) { + DEBUG ((DEBUG_INFO, "HTTP_STATUS_202_ACCEPTED\n")); } else if (ResponseData->Response.StatusCode =3D=3D HTTP_STATUS_413_REQU= EST_ENTITY_TOO_LARGE) { DEBUG ((DEBUG_INFO, "HTTP_STATUS_413_REQUEST_ENTITY_TOO_LARGE\n")); @@ -240,14 +271,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) && SendChunkProc= ess =3D=3D HttpIoSendChunkHeaderZeroContent) { DEBUG ((DEBUG_INFO, "Bad request may caused by zero length chunk. Tr= y to send all chunks...\n")); SendChunkProcess++; goto ReSendRequest; } } else if (ResponseData->Response.StatusCode =3D=3D HTTP_STATUS_100_CONT= INUE) { DEBUG ((DEBUG_INFO, "HTTP_STATUS_100_CONTINUE\n")); - if (SendChunkProcess =3D=3D HttpIoSendChunkHeaderZeroContent) { + if (FixedPcdGetBool(PcdRedfishRestExChunkRequestMode) && SendChunkProc= ess =3D=3D HttpIoSendChunkHeaderZeroContent) { // // We get HTTP_STATUS_100_CONTINUE to send the body using chunk tran= sfer. // @@ -256,7 +287,7 @@ ReSendRequest:; goto ReSendRequest; } - if (SendNonChunkProcess =3D=3D HttpIoSendNonChunkHeaderZeroContent) { + if (FixedPcdGetBool(PcdRedfishRestExChunkRequestMode) && SendNonChunkP= rocess =3D=3D HttpIoSendNonChunkHeaderZeroContent) { DEBUG ((DEBUG_INFO, "HTTP_STATUS_100_CONTINUE for non chunk transfer= ...\n")); SendNonChunkProcess++; goto ReSendRequest; @@ -394,7 +425,7 @@ ReSendRequest:; TotalReceivedSize +=3D ResponseData->BodyLength; } - DEBUG ((DEBUG_INFO, "Total of lengh of Response :%d\n", TotalReceivedS= ize)); + DEBUG ((DEBUG_INFO, "Total of length of Response :%d\n", TotalReceived= Size)); } DEBUG ((DEBUG_INFO, "RedfishRestExSendReceive()- EFI_STATUS: %r\n", Stat= us)); -- 2.6.1.windows.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= .