diff options
author | Zhang Lubo <lubo.zhang@intel.com> | 2016-01-28 03:15:35 +0000 |
---|---|---|
committer | luobozhang <luobozhang@Edk2> | 2016-01-28 03:15:35 +0000 |
commit | f0ab5a81b46b9bf0a8a4234782e70cb941d91f47 (patch) | |
tree | 4902f44667022202d54b871427dc7b9bb02f0f03 /NetworkPkg/HttpDxe | |
parent | 34d0017244462ee41a2b19994f2cb532cb86346b (diff) | |
download | edk2-platforms-f0ab5a81b46b9bf0a8a4234782e70cb941d91f47.tar.xz |
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 <lubo.zhang@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19761 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg/HttpDxe')
-rw-r--r-- | NetworkPkg/HttpDxe/HttpImpl.c | 55 | ||||
-rw-r--r-- | NetworkPkg/HttpDxe/HttpImpl.h | 20 |
2 files changed, 38 insertions, 37 deletions
diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c index aee3de517f..b46f0ae3ca 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.c +++ b/NetworkPkg/HttpDxe/HttpImpl.c @@ -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 @@ EFI_HTTP_PROTOCOL mEfiHttpTemplate = { @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 @@ EfiHttpGetModeData ( )
{
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 @@ EfiHttpGetModeData ( 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 @@ EfiHttpGetModeData ( 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 @@ EfiHttpGetModeData ( @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 @@ EfiHttpConfigure ( //
// 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 @@ EfiHttpConfigure ( 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 @@ HttpCancel ( @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 @@ Error: /**
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
diff --git a/NetworkPkg/HttpDxe/HttpImpl.h b/NetworkPkg/HttpDxe/HttpImpl.h index afbe982283..bfbaeccef2 100644 --- a/NetworkPkg/HttpDxe/HttpImpl.h +++ b/NetworkPkg/HttpDxe/HttpImpl.h @@ -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 @@ EfiHttpGetModeData ( 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 @@ EfiHttpGetModeData ( @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 @@ EfiHttpConfigure ( 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 @@ EfiHttpRequest ( @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 @@ EfiHttpCancel ( /**
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
|