Revision: 19761
          http://sourceforge.net/p/edk2/code/19761
Author:   luobozhang
Date:     2016-01-28 03:15:35 +0000 (Thu, 28 Jan 2016)
Log Message:
-----------
NetworkPkg: Change HTTP API typos.

Change HTTP API typos and clarify returned status code in HTTP API.


Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <[email protected]>
Reviewed-by: Fu Siyuan <[email protected]>
Reviewed-by: Ye Ting <[email protected]>
Reviewed-by: Wu Jiaxin <[email protected]>

Modified Paths:
--------------
    trunk/edk2/NetworkPkg/HttpDxe/HttpImpl.c
    trunk/edk2/NetworkPkg/HttpDxe/HttpImpl.h

Modified: trunk/edk2/NetworkPkg/HttpDxe/HttpImpl.c
===================================================================
--- trunk/edk2/NetworkPkg/HttpDxe/HttpImpl.c    2016-01-28 03:11:05 UTC (rev 
19760)
+++ trunk/edk2/NetworkPkg/HttpDxe/HttpImpl.c    2016-01-28 03:15:35 UTC (rev 
19761)
@@ -1,7 +1,7 @@
 /** @file
   Implementation of EFI_HTTP_PROTOCOL protocol interfaces.
 
-  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
   (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>
 
   This program and the accompanying materials
@@ -39,9 +39,11 @@
   @retval EFI_INVALID_PARAMETER   One or more of the following conditions is 
TRUE:
                                   This is NULL.
                                   HttpConfigData is NULL.
-                                  HttpConfigData->AccessPoint is NULL.
-  @retval EFI_OUT_OF_RESOURCES    Could not allocate enough system resources.
-  @retval EFI_NOT_STARTED         The HTTP instance is not configured.
+                                  HttpInstance->LocalAddressIsIPv6 is FALSE and
+                                  HttpConfigData->IPv4Node is NULL.
+                                  HttpInstance->LocalAddressIsIPv6 is TRUE and
+                                  HttpConfigData->IPv6Node is NULL.
+  @retval EFI_NOT_STARTED         This EFI HTTP Protocol instance has not been 
started.
 
 **/
 EFI_STATUS
@@ -52,16 +54,22 @@
   )
 {
   HTTP_PROTOCOL                 *HttpInstance;
-  EFI_HTTPv4_ACCESS_POINT       *Http4AccessPoint;
-  EFI_HTTPv6_ACCESS_POINT       *Http6AccessPoint;
 
+  //
+  // Check input parameters.
+  //
   if ((This == NULL) || (HttpConfigData == NULL)) {
     return EFI_INVALID_PARAMETER;
   }
-  
+
   HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This);
   ASSERT (HttpInstance != NULL);
-  
+
+  if ((HttpInstance->LocalAddressIsIPv6 && 
HttpConfigData->AccessPoint.IPv6Node == NULL) ||
+      (!HttpInstance->LocalAddressIsIPv6 && 
HttpConfigData->AccessPoint.IPv4Node == NULL)) {
+    return EFI_INVALID_PARAMETER;
+  }
+
   if (HttpInstance->State < HTTP_STATE_HTTP_CONFIGED) {
     return EFI_NOT_STARTED;
   }
@@ -71,27 +79,17 @@
   HttpConfigData->LocalAddressIsIPv6 = HttpInstance->LocalAddressIsIPv6;
 
   if (HttpInstance->LocalAddressIsIPv6) {
-    Http6AccessPoint = AllocateZeroPool (sizeof (EFI_HTTPv6_ACCESS_POINT));
-    if (Http6AccessPoint == NULL) {
-      return EFI_OUT_OF_RESOURCES;
-    }
     CopyMem (
-      Http6AccessPoint,
+      HttpConfigData->AccessPoint.IPv6Node,
       &HttpInstance->Ipv6Node,
       sizeof (HttpInstance->Ipv6Node)
     );
-    HttpConfigData->AccessPoint.IPv6Node = Http6AccessPoint;
   } else {
-    Http4AccessPoint = AllocateZeroPool (sizeof (EFI_HTTPv4_ACCESS_POINT));
-    if (Http4AccessPoint == NULL) {
-      return EFI_OUT_OF_RESOURCES;
-    }
     CopyMem (
-      Http4AccessPoint,
+      HttpConfigData->AccessPoint.IPv4Node,
       &HttpInstance->IPv4Node,
       sizeof (HttpInstance->IPv4Node)
       );
-    HttpConfigData->AccessPoint.IPv4Node = Http4AccessPoint;
   }
 
   return EFI_SUCCESS;
@@ -107,8 +105,8 @@
   connections with remote hosts, canceling all asynchronous tokens, and flush 
request
   and response buffers without informing the appropriate hosts.
 
-  Except for GetModeData() and Configure(), No other EFI HTTP function can be 
executed
-  by this instance until the Configure() function is executed and returns 
successfully.
+  No other EFI HTTP function can be executed by this instance until the 
Configure()
+  function is executed and returns successfully.
 
   @param[in]  This                Pointer to EFI_HTTP_PROTOCOL instance.
   @param[in]  HttpConfigData      Pointer to the configure data to configure 
the instance.
@@ -116,6 +114,7 @@
   @retval EFI_SUCCESS             Operation succeeded.
   @retval EFI_INVALID_PARAMETER   One or more of the following conditions is 
TRUE:
                                   This is NULL.
+                                  HttpConfigData is NULL.
                                   HttpConfigData->LocalAddressIsIPv6 is FALSE 
and
                                   HttpConfigData->IPv4Node is NULL.
                                   HttpConfigData->LocalAddressIsIPv6 is TRUE 
and
@@ -141,9 +140,10 @@
   //
   // Check input parameters.
   //
-  if (This == NULL || 
-     (HttpConfigData != NULL && ((HttpConfigData->LocalAddressIsIPv6 && 
HttpConfigData->AccessPoint.IPv6Node == NULL) ||
-                                 (!HttpConfigData->LocalAddressIsIPv6 && 
HttpConfigData->AccessPoint.IPv4Node == NULL)))) {
+  if (This == NULL ||
+      HttpConfigData == NULL ||
+     ((HttpConfigData->LocalAddressIsIPv6 && 
HttpConfigData->AccessPoint.IPv6Node == NULL) ||
+     (!HttpConfigData->LocalAddressIsIPv6 && 
HttpConfigData->AccessPoint.IPv4Node == NULL))) {
     return EFI_INVALID_PARAMETER;
   }
 
@@ -217,6 +217,7 @@
                                   implementation.
   @retval EFI_INVALID_PARAMETER   One or more of the following conditions is 
TRUE:
                                   This is NULL.
+                                  Token is NULL.
                                   Token->Message is NULL.
                                   Token->Message->Body is not NULL,
                                   Token->Message->BodyLength is non-zero, and
@@ -723,8 +724,6 @@
   @retval EFI_SUCCESS             Request and Response queues are successfully 
flushed.
   @retval EFI_INVALID_PARAMETER   This is NULL.
   @retval EFI_NOT_STARTED         This instance hasn't been configured.
-  @retval EFI_NO_MAPPING          When using the default address, 
configuration (DHCP,
-                                  BOOTP, RARP, etc.) hasn't finished yet.
   @retval EFI_NOT_FOUND           The asynchronous request or response token 
is not
                                   found.
   @retval EFI_UNSUPPORTED         The implementation does not support this 
function.
@@ -1147,7 +1146,7 @@
 
 /**
   The Response() function queues an HTTP response to this HTTP instance, 
similar to
-  Receive() function in the EFI TCP driver. When the HTTP request is sent 
successfully,
+  Receive() function in the EFI TCP driver. When the HTTP response is received 
successfully,
   or if there is an error, Status in token will be updated and Event will be 
signaled.
 
   The HTTP driver will queue a receive token to the underlying TCP instance. 
When data

Modified: trunk/edk2/NetworkPkg/HttpDxe/HttpImpl.h
===================================================================
--- trunk/edk2/NetworkPkg/HttpDxe/HttpImpl.h    2016-01-28 03:11:05 UTC (rev 
19760)
+++ trunk/edk2/NetworkPkg/HttpDxe/HttpImpl.h    2016-01-28 03:15:35 UTC (rev 
19761)
@@ -1,7 +1,7 @@
 /** @file
   The header files of implementation of EFI_HTTP_PROTOCOL protocol interfaces.
 
-  Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
 
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
@@ -43,9 +43,11 @@
   @retval EFI_INVALID_PARAMETER   One or more of the following conditions is 
TRUE:
                                   This is NULL.
                                   HttpConfigData is NULL.
-                                  HttpConfigData->AccessPoint is NULL.
-  @retval EFI_OUT_OF_RESOURCES    Could not allocate enough system resources.
-  @retval EFI_NOT_STARTED         The HTTP instance is not configured.
+                                  HttpInstance->LocalAddressIsIPv6 is FALSE and
+                                  HttpConfigData->IPv4Node is NULL.
+                                  HttpInstance->LocalAddressIsIPv6 is TRUE and
+                                  HttpConfigData->IPv6Node is NULL.
+  @retval EFI_NOT_STARTED         This EFI HTTP Protocol instance has not been 
started.
 
 **/
 EFI_STATUS
@@ -65,8 +67,8 @@
   connections with remote hosts, canceling all asynchronous tokens, and flush 
request
   and response buffers without informing the appropriate hosts.
 
-  Except for GetModeData() and Configure(), No other EFI HTTP function can be 
executed
-  by this instance until the Configure() function is executed and returns 
successfully.
+  No other EFI HTTP function can be executed by this instance until the 
Configure() 
+  function is executed and returns successfully.
 
   @param[in]  This                Pointer to EFI_HTTP_PROTOCOL instance.
   @param[in]  HttpConfigData      Pointer to the configure data to configure 
the instance.
@@ -74,6 +76,7 @@
   @retval EFI_SUCCESS             Operation succeeded.
   @retval EFI_INVALID_PARAMETER   One or more of the following conditions is 
TRUE:
                                   This is NULL.
+                                  HttpConfigData is NULL.
                                   HttpConfigData->LocalAddressIsIPv6 is FALSE 
and
                                   HttpConfigData->IPv4Node is NULL.
                                   HttpConfigData->LocalAddressIsIPv6 is TRUE 
and
@@ -112,6 +115,7 @@
                                   implementation.
   @retval EFI_INVALID_PARAMETER   One or more of the following conditions is 
TRUE:
                                   This is NULL.
+                                  Token is NULL.
                                   Token->Message is NULL.
                                   Token->Message->Body is not NULL,
                                   Token->Message->BodyLength is non-zero, and
@@ -142,8 +146,6 @@
   @retval EFI_SUCCESS             Request and Response queues are successfully 
flushed.
   @retval EFI_INVALID_PARAMETER   This is NULL.
   @retval EFI_NOT_STARTED         This instance hasn't been configured.
-  @retval EFI_NO_MAPPING          When using the default address, 
configuration (DHCP,
-                                  BOOTP, RARP, etc.) hasn't finished yet.
   @retval EFI_NOT_FOUND           The asynchronous request or response token 
is not
                                   found.
   @retval EFI_UNSUPPORTED         The implementation does not support this 
function.
@@ -157,7 +159,7 @@
 
 /**
   The Response() function queues an HTTP response to this HTTP instance, 
similar to
-  Receive() function in the EFI TCP driver. When the HTTP request is sent 
successfully,
+  Receive() function in the EFI TCP driver. When the HTTP response is received 
successfully,
   or if there is an error, Status in token will be updated and Event will be 
signaled.
 
   The HTTP driver will queue a receive token to the underlying TCP instance. 
When data


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to