From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 7F12721E1DADD for ; Thu, 3 Aug 2017 01:37:43 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 03 Aug 2017 01:39:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,315,1498546800"; d="scan'208";a="885885619" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by FMSMGA003.fm.intel.com with ESMTP; 03 Aug 2017 01:39:54 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 3 Aug 2017 01:39:54 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 3 Aug 2017 01:39:53 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.116]) by shsmsx102.ccr.corp.intel.com ([169.254.2.146]) with mapi id 14.03.0319.002; Thu, 3 Aug 2017 16:39:50 +0800 From: "Ye, Ting" To: "Wu, Jiaxin" , "edk2-devel@lists.01.org" CC: "Fu, Siyuan" Thread-Topic: [Patch] NetworkPkg/HttpDxe: Support HTTP Patch method Thread-Index: AQHTC2WRAMHIF9PZn0urCCv2wFcBAqJyUULg Date: Thu, 3 Aug 2017 08:39:50 +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: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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: Thu, 03 Aug 2017 08:37:43 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ye Ting =20 -----Original Message----- From: Wu, Jiaxin=20 Sent: Wednesday, August 02, 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=20 + HttpMethodPatch)) { 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=20 + current 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=20 + pair, we 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=20 + 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. // -- 1.9.5.msysgit.1