From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EE93321DF37AE for ; Wed, 2 Aug 2017 01:02:38 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Aug 2017 01:04:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,310,1498546800"; d="scan'208";a="294578774" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga004.fm.intel.com with ESMTP; 02 Aug 2017 01:04:40 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 2 Aug 2017 01:04:40 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 2 Aug 2017 01:04:40 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.134]) with mapi id 14.03.0319.002; Wed, 2 Aug 2017 16:04:36 +0800 From: "Fu, Siyuan" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Ye, Ting" Thread-Topic: [Patch] NetworkPkg/HttpDxe: Support HTTP Patch method Thread-Index: AQHTC2WRib66Sxkv0UuSPSZMmF/iGaJwtSAg Date: Wed, 2 Aug 2017 08:04:35 +0000 Message-ID: References: <1501660861-11492-1-git-send-email-jiaxin.wu@intel.com> In-Reply-To: <1501660861-11492-1-git-send-email-jiaxin.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] NetworkPkg/HttpDxe: Support HTTP Patch method X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Aug 2017 08:02:39 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Fu Siyuan -----Original Message----- From: Wu, Jiaxin=20 Sent: Wednesday, August 2, 2017 4:01 PM To: edk2-devel@lists.01.org Cc: Ye, Ting ; Fu, Siyuan ; Wu, Jia= xin Subject: [Patch] NetworkPkg/HttpDxe: Support HTTP Patch method Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin --- NetworkPkg/HttpDxe/HttpImpl.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index 8a9e573..e0fecac 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.c +++ b/NetworkPkg/HttpDxe/HttpImpl.c @@ -274,14 +274,15 @@ EfiHttpRequest ( } =20 Request =3D HttpMsg->Data.Request; =20 // - // Only support GET, HEAD, PUT and POST method in current implementation= . + // Only support GET, HEAD, PATCH, PUT and POST method in current impleme= ntation. // if ((Request !=3D NULL) && (Request->Method !=3D HttpMethodGet) && - (Request->Method !=3D HttpMethodHead) && (Request->Method !=3D HttpM= ethodPut) && (Request->Method !=3D HttpMethodPost)) { + (Request->Method !=3D HttpMethodHead) && (Request->Method !=3D HttpM= ethodPut) &&=20 + (Request->Method !=3D HttpMethodPost) && (Request->Method !=3D HttpM= ethodPatch)) { return EFI_UNSUPPORTED; } =20 HttpInstance =3D HTTP_INSTANCE_FROM_PROTOCOL (This); ASSERT (HttpInstance !=3D NULL); @@ -297,18 +298,20 @@ EfiHttpRequest ( return EFI_NOT_STARTED; } =20 if (Request =3D=3D NULL) { // - // Request would be NULL only for PUT/POST operation (in the current i= mplementation) + // Request would be NULL only for PUT/POST/PATCH operation (in the cur= rent implementation) // - if ((HttpInstance->Method !=3D HttpMethodPut) && (HttpInstance->Method= !=3D HttpMethodPost)) { + if ((HttpInstance->Method !=3D HttpMethodPut) &&=20 + (HttpInstance->Method !=3D HttpMethodPost) &&=20 + (HttpInstance->Method !=3D HttpMethodPatch)) { return EFI_INVALID_PARAMETER; } =20 // - // For PUT/POST, we need to have the TCP already configured. Bail out = if it is not! + // For PUT/POST/PATCH, we need to have the TCP already configured. Bai= l out if it is not! // if (HttpInstance->State < HTTP_STATE_TCP_CONFIGED) { return EFI_INVALID_PARAMETER; } =20 @@ -615,11 +618,11 @@ EfiHttpRequest ( =20 ASSERT (RequestMsg !=3D NULL); =20 // // Every request we insert a TxToken and a response call would remove th= e TxToken. - // In cases of PUT/POST, after an initial request-response pair, we woul= d do a + // In cases of PUT/POST/PATCH, after an initial request-response pair, w= e would do a // continuous request without a response call. So, in such cases, where = Request // structure is NULL, we would not insert a TxToken. // if (Request !=3D NULL) { Status =3D NetMapInsertTail (&HttpInstance->TxTokens, Token, Wrap); @@ -1111,11 +1114,11 @@ HttpResponseWorker ( =20 Status =3D EFI_NOT_READY; ValueInItem =3D NULL; =20 // - // In cases of PUT/POST, after an initial request-response pair, we wo= uld do a + // In cases of PUT/POST/PATCH, after an initial request-response pair,= we would do a // continuous request without a response call. So, we would not do an = insert of // TxToken. After we have sent the complete file, we will call a respo= nse to get // a final response from server. In such a case, we would not have any= TxTokens. // Hence, check that case before doing a NetMapRemoveHead. // --=20 1.9.5.msysgit.1