From nobody Thu Dec 26 13:07:19 2024 Delivered-To: importer@patchew.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 1506577319918725.3047168998755; Wed, 27 Sep 2017 22:41:59 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 5D47E21EC8D19; Wed, 27 Sep 2017 22:38:43 -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 C30C821EC8D18 for ; Wed, 27 Sep 2017 22:38:41 -0700 (PDT) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Sep 2017 22:41:56 -0700 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.220]) by fmsmga005.fm.intel.com with ESMTP; 27 Sep 2017 22:41:54 -0700 X-Original-To: edk2-devel@lists.01.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; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,448,1500966000"; d="scan'208";a="156425598" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Thu, 28 Sep 2017 13:41:50 +0800 Message-Id: <1506577310-40432-3-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1506577310-40432-1-git-send-email-jiaxin.wu@intel.com> References: <1506577310-40432-1-git-send-email-jiaxin.wu@intel.com> Subject: [edk2] [Patch 2/2] NetworkPkg/HttpDxe: Clarify the usage of HttpConfigData in HTTP protocol 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 --- NetworkPkg/HttpDxe/HttpImpl.c | 20 +++++++++++--------- NetworkPkg/HttpDxe/HttpImpl.h | 18 ++++++++++-------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index c104b61..46d0323 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.c +++ b/NetworkPkg/HttpDxe/HttpImpl.c @@ -31,20 +31,22 @@ EFI_HTTP_PROTOCOL mEfiHttpTemplate =3D { The GetModeData() function is used to read the current mode data (operat= ional parameters) for this HTTP protocol instance. =20 @param[in] This Pointer to EFI_HTTP_PROTOCOL instance. @param[out] HttpConfigData Point to buffer for operational paramete= rs of this - HTTP instance. + HTTP instance. It is the responsibility = of the caller=20 + to allocate the memory for HttpConfigDat= a and=20 + HttpConfigData->AccessPoint.IPv6Node/IPv= 4Node. In fact,=20 + it is recommended to allocate sufficient= memory to record=20 + IPv6Node since it is big enough for all = possibilities.=20 =20 @retval EFI_SUCCESS Operation succeeded. @retval EFI_INVALID_PARAMETER One or more of the following conditions = is TRUE: This is NULL. HttpConfigData is NULL. - HttpInstance->LocalAddressIsIPv6 is FALS= E and - HttpConfigData->IPv4Node is NULL. - HttpInstance->LocalAddressIsIPv6 is TRUE= and - HttpConfigData->IPv6Node is NULL. + HttpConfigData->AccessPoint.IPv4Node or=20 + HttpConfigData->AccessPoint.IPv6Node is = NULL. @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not = been started. =20 **/ EFI_STATUS EFIAPI @@ -63,12 +65,12 @@ EfiHttpGetModeData ( } =20 HttpInstance =3D HTTP_INSTANCE_FROM_PROTOCOL (This); ASSERT (HttpInstance !=3D NULL); =20 - if ((HttpInstance->LocalAddressIsIPv6 && HttpConfigData->AccessPoint.IPv= 6Node =3D=3D NULL) || - (!HttpInstance->LocalAddressIsIPv6 && HttpConfigData->AccessPoint.IP= v4Node =3D=3D NULL)) { + if ((HttpConfigData->AccessPoint.IPv6Node =3D=3D NULL) || + (HttpConfigData->AccessPoint.IPv4Node =3D=3D NULL)) { return EFI_INVALID_PARAMETER; } =20 if (HttpInstance->State < HTTP_STATE_HTTP_CONFIGED) { return EFI_NOT_STARTED; @@ -113,13 +115,13 @@ EfiHttpGetModeData ( =20 @retval EFI_SUCCESS Operation succeeded. @retval EFI_INVALID_PARAMETER One or more of the following conditions = is TRUE: This is NULL. HttpConfigData->LocalAddressIsIPv6 is FA= LSE and - HttpConfigData->IPv4Node is NULL. + HttpConfigData->AccessPoint.IPv4Node is = NULL. HttpConfigData->LocalAddressIsIPv6 is TR= UE and - HttpConfigData->IPv6Node is NULL. + HttpConfigData->AccessPoint.IPv6Node is = NULL. @retval EFI_ALREADY_STARTED Reinitialize this HTTP instance without = calling Configure() with NULL to reset it. @retval EFI_DEVICE_ERROR An unexpected system or network error oc= curred. @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resourc= es when executing Configure(). diff --git a/NetworkPkg/HttpDxe/HttpImpl.h b/NetworkPkg/HttpDxe/HttpImpl.h index 40b2504..6550ce0 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.h +++ b/NetworkPkg/HttpDxe/HttpImpl.h @@ -1,9 +1,9 @@ /** @file The header files of implementation of EFI_HTTP_PROTOCOL protocol interfa= ces. =20 - Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
=20 =20 This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -31,20 +31,22 @@ The GetModeData() function is used to read the current mode data (operat= ional parameters) for this HTTP protocol instance. =20 @param[in] This Pointer to EFI_HTTP_PROTOCOL instance. @param[out] HttpConfigData Point to buffer for operational paramete= rs of this - HTTP instance. + HTTP instance. It is the responsibility = of the caller=20 + to allocate the memory for HttpConfigDat= a and=20 + HttpConfigData->AccessPoint.IPv6Node/IPv= 4Node. In fact,=20 + it is recommended to allocate sufficient= memory to record=20 + IPv6Node since it is big enough for all = possibilities. =20 @retval EFI_SUCCESS Operation succeeded. @retval EFI_INVALID_PARAMETER One or more of the following conditions = is TRUE: This is NULL. HttpConfigData is NULL. - HttpInstance->LocalAddressIsIPv6 is FALS= E and - HttpConfigData->IPv4Node is NULL. - HttpInstance->LocalAddressIsIPv6 is TRUE= and - HttpConfigData->IPv6Node is NULL. + HttpConfigData->AccessPoint.IPv4Node or=20 + HttpConfigData->AccessPoint.IPv6Node is = NULL. @retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not = been started. =20 **/ EFI_STATUS EFIAPI @@ -71,13 +73,13 @@ EfiHttpGetModeData ( =20 @retval EFI_SUCCESS Operation succeeded. @retval EFI_INVALID_PARAMETER One or more of the following conditions = is TRUE: This is NULL. HttpConfigData->LocalAddressIsIPv6 is FA= LSE and - HttpConfigData->IPv4Node is NULL. + HttpConfigData->AccessPoint.IPv4Node is = NULL. HttpConfigData->LocalAddressIsIPv6 is TR= UE and - HttpConfigData->IPv6Node is NULL. + HttpConfigData->AccessPoint.IPv6Node is = NULL. @retval EFI_ALREADY_STARTED Reinitialize this HTTP instance without = calling Configure() with NULL to reset it. @retval EFI_DEVICE_ERROR An unexpected system or network error oc= curred. @retval EFI_OUT_OF_RESOURCES Could not allocate enough system resourc= es when executing Configure(). --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel