From nobody Fri Dec 27 02:35:00 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1501660875084454.6727828976076; Wed, 2 Aug 2017 01:01:15 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 689F321DF37B2; Wed, 2 Aug 2017 00:59:02 -0700 (PDT) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 C911C21DF37AD for ; Wed, 2 Aug 2017 00:59:00 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Aug 2017 01:01:09 -0700 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.149]) by orsmga005.jf.intel.com with ESMTP; 02 Aug 2017 01:01:08 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,310,1498546800"; d="scan'208";a="132409492" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Wed, 2 Aug 2017 16:01:01 +0800 Message-Id: <1501660861-11492-1-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 Subject: [edk2] [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: , Cc: Ye Ting , Fu Siyuan , Wu Jiaxin MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin Reviewed-by: Fu Siyuan Reviewed-by: Ye Ting =20 --- 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 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel