public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch 0/2] Clarify the usage of HttpConfigData in HTTP protocol
@ 2017-09-28  5:41 Jiaxin Wu
  2017-09-28  5:41 ` [Patch 1/2] MdePkg/Http.h: " Jiaxin Wu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jiaxin Wu @ 2017-09-28  5:41 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ye Ting, Fu Siyuan, Wu Jiaxin

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>

Jiaxin Wu (2):
  MdePkg/Http.h: Clarify the usage of HttpConfigData in HTTP protocol
  NetworkPkg/HttpDxe: Clarify the usage of HttpConfigData in HTTP
    protocol

 MdePkg/Include/Protocol/Http.h | 16 +++++++++-------
 NetworkPkg/HttpDxe/HttpImpl.c  | 20 +++++++++++---------
 NetworkPkg/HttpDxe/HttpImpl.h  | 18 ++++++++++--------
 3 files changed, 30 insertions(+), 24 deletions(-)

-- 
1.9.5.msysgit.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Patch 1/2] MdePkg/Http.h: Clarify the usage of HttpConfigData in HTTP protocol
  2017-09-28  5:41 [Patch 0/2] Clarify the usage of HttpConfigData in HTTP protocol Jiaxin Wu
@ 2017-09-28  5:41 ` Jiaxin Wu
  2017-09-28  5:41 ` [Patch 2/2] NetworkPkg/HttpDxe: " Jiaxin Wu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jiaxin Wu @ 2017-09-28  5:41 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ye Ting, Fu Siyuan, Wu Jiaxin

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 MdePkg/Include/Protocol/Http.h | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/MdePkg/Include/Protocol/Http.h b/MdePkg/Include/Protocol/Http.h
index 297d9c3..bdcd7b1 100644
--- a/MdePkg/Include/Protocol/Http.h
+++ b/MdePkg/Include/Protocol/Http.h
@@ -303,19 +303,21 @@ typedef struct {
   The GetModeData() function is used to read the current mode data (operational
   parameters) for this HTTP protocol instance.
 
   @param[in]  This                Pointer to EFI_HTTP_PROTOCOL instance.
   @param[out] HttpConfigData      Point to buffer for operational parameters of this
-                                  HTTP instance.
+                                  HTTP instance. It is the responsibility of the caller 
+                                  to allocate the memory for HttpConfigData and 
+                                  HttpConfigData->AccessPoint.IPv6Node/IPv4Node. In fact, 
+                                  it is recommended to allocate sufficient memory to record 
+                                  IPv6Node since it is big enough for all possibilities.
 
   @retval EFI_SUCCESS             Operation succeeded.
   @retval EFI_INVALID_PARAMETER   This is NULL.
                                   HttpConfigData is NULL.
-                                  HttpInstance->LocalAddressIsIPv6 is FALSE and
-                                  HttpConfigData->IPv4Node is NULL.
-                                  HttpInstance->LocalAddressIsIPv6 is TRUE and
-                                  HttpConfigData->IPv6Node is NULL.
+                                  HttpConfigData->AccessPoint.IPv4Node or 
+                                  HttpConfigData->AccessPoint.IPv6Node is NULL.
   @retval EFI_NOT_STARTED         This EFI HTTP Protocol instance has not been started.
 **/
 typedef
 EFI_STATUS
 (EFIAPI *EFI_HTTP_GET_MODE_DATA)(
@@ -341,13 +343,13 @@ EFI_STATUS
 
   @retval EFI_SUCCESS             Operation succeeded.
   @retval EFI_INVALID_PARAMETER   One or more of the following conditions is TRUE:
                                   This is NULL.
                                   HttpConfigData->LocalAddressIsIPv6 is FALSE and
-                                  HttpConfigData->IPv4Node is NULL.
+                                  HttpConfigData->AccessPoint.IPv4Node is NULL.
                                   HttpConfigData->LocalAddressIsIPv6 is TRUE 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 occurred.
   @retval EFI_OUT_OF_RESOURCES    Could not allocate enough system resources when
                                   executing Configure().
-- 
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Patch 2/2] NetworkPkg/HttpDxe: Clarify the usage of HttpConfigData in HTTP protocol
  2017-09-28  5:41 [Patch 0/2] Clarify the usage of HttpConfigData in HTTP protocol Jiaxin Wu
  2017-09-28  5:41 ` [Patch 1/2] MdePkg/Http.h: " Jiaxin Wu
@ 2017-09-28  5:41 ` Jiaxin Wu
  2017-09-28  7:23 ` [Patch 0/2] " Fu, Siyuan
  2017-09-28  7:35 ` Ye, Ting
  3 siblings, 0 replies; 5+ messages in thread
From: Jiaxin Wu @ 2017-09-28  5:41 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ye Ting, Fu Siyuan, Wu Jiaxin

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
---
 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 = {
   The GetModeData() function is used to read the current mode data (operational
   parameters) for this HTTP protocol instance.
 
   @param[in]  This                Pointer to EFI_HTTP_PROTOCOL instance.
   @param[out] HttpConfigData      Point to buffer for operational parameters of this
-                                  HTTP instance.
+                                  HTTP instance. It is the responsibility of the caller 
+                                  to allocate the memory for HttpConfigData and 
+                                  HttpConfigData->AccessPoint.IPv6Node/IPv4Node. In fact, 
+                                  it is recommended to allocate sufficient memory to record 
+                                  IPv6Node since it is big enough for all possibilities. 
 
   @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 FALSE and
-                                  HttpConfigData->IPv4Node is NULL.
-                                  HttpInstance->LocalAddressIsIPv6 is TRUE and
-                                  HttpConfigData->IPv6Node is NULL.
+                                  HttpConfigData->AccessPoint.IPv4Node or 
+                                  HttpConfigData->AccessPoint.IPv6Node is NULL.
   @retval EFI_NOT_STARTED         This EFI HTTP Protocol instance has not been started.
 
 **/
 EFI_STATUS
 EFIAPI
@@ -63,12 +65,12 @@ EfiHttpGetModeData (
   }
 
   HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This);
   ASSERT (HttpInstance != NULL);
 
-  if ((HttpInstance->LocalAddressIsIPv6 && HttpConfigData->AccessPoint.IPv6Node == NULL) ||
-      (!HttpInstance->LocalAddressIsIPv6 && HttpConfigData->AccessPoint.IPv4Node == NULL)) {
+  if ((HttpConfigData->AccessPoint.IPv6Node == NULL) ||
+      (HttpConfigData->AccessPoint.IPv4Node == NULL)) {
     return EFI_INVALID_PARAMETER;
   }
 
   if (HttpInstance->State < HTTP_STATE_HTTP_CONFIGED) {
     return EFI_NOT_STARTED;
@@ -113,13 +115,13 @@ EfiHttpGetModeData (
 
   @retval EFI_SUCCESS             Operation succeeded.
   @retval EFI_INVALID_PARAMETER   One or more of the following conditions is TRUE:
                                   This is NULL.
                                   HttpConfigData->LocalAddressIsIPv6 is FALSE and
-                                  HttpConfigData->IPv4Node is NULL.
+                                  HttpConfigData->AccessPoint.IPv4Node is NULL.
                                   HttpConfigData->LocalAddressIsIPv6 is TRUE 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 occurred.
   @retval EFI_OUT_OF_RESOURCES    Could not allocate enough system resources 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 interfaces.
 
-  Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
   (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>  
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
@@ -31,20 +31,22 @@
   The GetModeData() function is used to read the current mode data (operational
   parameters) for this HTTP protocol instance.
 
   @param[in]  This                Pointer to EFI_HTTP_PROTOCOL instance.
   @param[out] HttpConfigData      Point to buffer for operational parameters of this
-                                  HTTP instance.
+                                  HTTP instance. It is the responsibility of the caller 
+                                  to allocate the memory for HttpConfigData and 
+                                  HttpConfigData->AccessPoint.IPv6Node/IPv4Node. In fact, 
+                                  it is recommended to allocate sufficient memory to record 
+                                  IPv6Node since it is big enough for all possibilities.
 
   @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 FALSE and
-                                  HttpConfigData->IPv4Node is NULL.
-                                  HttpInstance->LocalAddressIsIPv6 is TRUE and
-                                  HttpConfigData->IPv6Node is NULL.
+                                  HttpConfigData->AccessPoint.IPv4Node or 
+                                  HttpConfigData->AccessPoint.IPv6Node is NULL.
   @retval EFI_NOT_STARTED         This EFI HTTP Protocol instance has not been started.
 
 **/
 EFI_STATUS
 EFIAPI
@@ -71,13 +73,13 @@ EfiHttpGetModeData (
 
   @retval EFI_SUCCESS             Operation succeeded.
   @retval EFI_INVALID_PARAMETER   One or more of the following conditions is TRUE:
                                   This is NULL.
                                   HttpConfigData->LocalAddressIsIPv6 is FALSE and
-                                  HttpConfigData->IPv4Node is NULL.
+                                  HttpConfigData->AccessPoint.IPv4Node is NULL.
                                   HttpConfigData->LocalAddressIsIPv6 is TRUE 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 occurred.
   @retval EFI_OUT_OF_RESOURCES    Could not allocate enough system resources when
                                   executing Configure().
-- 
1.9.5.msysgit.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Patch 0/2] Clarify the usage of HttpConfigData in HTTP protocol
  2017-09-28  5:41 [Patch 0/2] Clarify the usage of HttpConfigData in HTTP protocol Jiaxin Wu
  2017-09-28  5:41 ` [Patch 1/2] MdePkg/Http.h: " Jiaxin Wu
  2017-09-28  5:41 ` [Patch 2/2] NetworkPkg/HttpDxe: " Jiaxin Wu
@ 2017-09-28  7:23 ` Fu, Siyuan
  2017-09-28  7:35 ` Ye, Ting
  3 siblings, 0 replies; 5+ messages in thread
From: Fu, Siyuan @ 2017-09-28  7:23 UTC (permalink / raw)
  To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Ye, Ting

Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>



-----Original Message-----
From: Wu, Jiaxin 
Sent: Thursday, September 28, 2017 1:42 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [Patch 0/2] Clarify the usage of HttpConfigData in HTTP protocol

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>

Jiaxin Wu (2):
  MdePkg/Http.h: Clarify the usage of HttpConfigData in HTTP protocol
  NetworkPkg/HttpDxe: Clarify the usage of HttpConfigData in HTTP
    protocol

 MdePkg/Include/Protocol/Http.h | 16 +++++++++-------
 NetworkPkg/HttpDxe/HttpImpl.c  | 20 +++++++++++---------
 NetworkPkg/HttpDxe/HttpImpl.h  | 18 ++++++++++--------
 3 files changed, 30 insertions(+), 24 deletions(-)

-- 
1.9.5.msysgit.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Patch 0/2] Clarify the usage of HttpConfigData in HTTP protocol
  2017-09-28  5:41 [Patch 0/2] Clarify the usage of HttpConfigData in HTTP protocol Jiaxin Wu
                   ` (2 preceding siblings ...)
  2017-09-28  7:23 ` [Patch 0/2] " Fu, Siyuan
@ 2017-09-28  7:35 ` Ye, Ting
  3 siblings, 0 replies; 5+ messages in thread
From: Ye, Ting @ 2017-09-28  7:35 UTC (permalink / raw)
  To: Wu, Jiaxin, edk2-devel@lists.01.org; +Cc: Fu, Siyuan

Series Reviewed-by: Ye Ting <ting.ye@intel.com> 

-----Original Message-----
From: Wu, Jiaxin 
Sent: Thursday, September 28, 2017 1:42 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [Patch 0/2] Clarify the usage of HttpConfigData in HTTP protocol

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>

Jiaxin Wu (2):
  MdePkg/Http.h: Clarify the usage of HttpConfigData in HTTP protocol
  NetworkPkg/HttpDxe: Clarify the usage of HttpConfigData in HTTP
    protocol

 MdePkg/Include/Protocol/Http.h | 16 +++++++++-------  NetworkPkg/HttpDxe/HttpImpl.c  | 20 +++++++++++---------  NetworkPkg/HttpDxe/HttpImpl.h  | 18 ++++++++++--------
 3 files changed, 30 insertions(+), 24 deletions(-)

--
1.9.5.msysgit.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-09-28  7:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-28  5:41 [Patch 0/2] Clarify the usage of HttpConfigData in HTTP protocol Jiaxin Wu
2017-09-28  5:41 ` [Patch 1/2] MdePkg/Http.h: " Jiaxin Wu
2017-09-28  5:41 ` [Patch 2/2] NetworkPkg/HttpDxe: " Jiaxin Wu
2017-09-28  7:23 ` [Patch 0/2] " Fu, Siyuan
2017-09-28  7:35 ` Ye, Ting

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox