NetworkPkg: Clean up source files

1. Do not use tab characters
2. No trailing white space in one line
3. All files must end with CRLF

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
Liming Gao
2018-06-27 21:12:32 +08:00
parent 9095d37b8f
commit f75a7f568e
180 changed files with 3642 additions and 3642 deletions

View File

@@ -2,7 +2,7 @@
Implementation of EFI_COMPONENT_NAME_PROTOCOL and
EFI_COMPONENT_NAME2_PROTOCOL protocol.
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, 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
@@ -19,7 +19,7 @@
///
/// Component Name Protocol instance
///
GLOBAL_REMOVE_IF_UNREFERENCED
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_COMPONENT_NAME_PROTOCOL gHttpDxeComponentName = {
(EFI_COMPONENT_NAME_GET_DRIVER_NAME) HttpDxeComponentNameGetDriverName,
(EFI_COMPONENT_NAME_GET_CONTROLLER_NAME) HttpDxeComponentNameGetControllerName,
@@ -29,7 +29,7 @@ EFI_COMPONENT_NAME_PROTOCOL gHttpDxeComponentName = {
///
/// Component Name 2 Protocol instance
///
GLOBAL_REMOVE_IF_UNREFERENCED
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_COMPONENT_NAME2_PROTOCOL gHttpDxeComponentName2 = {
HttpDxeComponentNameGetDriverName,
HttpDxeComponentNameGetControllerName,
@@ -39,7 +39,7 @@ EFI_COMPONENT_NAME2_PROTOCOL gHttpDxeComponentName2 = {
///
/// Table of driver names
///
GLOBAL_REMOVE_IF_UNREFERENCED
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_UNICODE_STRING_TABLE mHttpDxeDriverNameTable[] = {
{ "eng;en", (CHAR16 *) L"HttpDxe" },
{ NULL, NULL }

View File

@@ -1,7 +1,7 @@
/** @file
Routines for HttpDxe driver to perform DNS resolution based on UEFI DNS protocols.
Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2017 - 2018, 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
which accompanies this distribution. The full text of the license may be found at
@@ -25,13 +25,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
@retval EFI_DEVICE_ERROR An unexpected network error occurred.
@retval Others Other errors as indicated.
**/
EFI_STATUS
HttpDns4 (
IN HTTP_PROTOCOL *HttpInstance,
IN CHAR16 *HostName,
OUT EFI_IPv4_ADDRESS *IpAddress
OUT EFI_IPv4_ADDRESS *IpAddress
)
{
EFI_STATUS Status;
@@ -45,7 +45,7 @@ HttpDns4 (
UINTN DnsServerListCount;
EFI_IPv4_ADDRESS *DnsServerList;
UINTN DataSize;
Service = HttpInstance->Service;
ASSERT (Service != NULL);
@@ -82,7 +82,7 @@ HttpDns4 (
Dns4Handle = NULL;
Dns4 = NULL;
//
// Create a DNS child instance and get the protocol.
//
@@ -94,7 +94,7 @@ HttpDns4 (
);
if (EFI_ERROR (Status)) {
goto Exit;
}
}
Status = gBS->OpenProtocol (
Dns4Handle,
@@ -128,7 +128,7 @@ HttpDns4 (
if (EFI_ERROR (Status)) {
goto Exit;
}
//
// Create event to set the is done flag when name resolution is finished.
//
@@ -161,7 +161,7 @@ HttpDns4 (
//
// Name resolution is done, check result.
//
Status = Token.Status;
Status = Token.Status;
if (!EFI_ERROR (Status)) {
if (Token.RspData.H2AData == NULL) {
Status = EFI_DEVICE_ERROR;
@@ -179,7 +179,7 @@ HttpDns4 (
}
Exit:
if (Token.Event != NULL) {
gBS->CloseEvent (Token.Event);
}
@@ -192,7 +192,7 @@ Exit:
if (Dns4 != NULL) {
Dns4->Configure (Dns4, NULL);
gBS->CloseProtocol (
Dns4Handle,
&gEfiDns4ProtocolGuid,
@@ -213,7 +213,7 @@ Exit:
if (DnsServerList != NULL) {
FreePool (DnsServerList);
}
return Status;
}
@@ -228,13 +228,13 @@ Exit:
@retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
@retval EFI_DEVICE_ERROR An unexpected network error occurred.
@retval Others Other errors as indicated.
**/
EFI_STATUS
HttpDns6 (
IN HTTP_PROTOCOL *HttpInstance,
IN CHAR16 *HostName,
OUT EFI_IPv6_ADDRESS *IpAddress
OUT EFI_IPv6_ADDRESS *IpAddress
)
{
EFI_STATUS Status;
@@ -248,7 +248,7 @@ HttpDns6 (
UINTN DnsServerListCount;
UINTN DataSize;
BOOLEAN IsDone;
Service = HttpInstance->Service;
ASSERT (Service != NULL);
@@ -258,7 +258,7 @@ HttpDns6 (
Dns6 = NULL;
Dns6Handle = NULL;
ZeroMem (&Token, sizeof (EFI_DNS6_COMPLETION_TOKEN));
//
// Get DNS server list from EFI IPv6 Configuration protocol.
//
@@ -273,7 +273,7 @@ HttpDns6 (
DnsServerList = AllocatePool (DataSize);
if (DnsServerList == NULL) {
return EFI_OUT_OF_RESOURCES;
}
}
Status = Ip6Config->GetData (Ip6Config, Ip6ConfigDataTypeDnsServer, &DataSize, DnsServerList);
if (EFI_ERROR (Status)) {
@@ -296,8 +296,8 @@ HttpDns6 (
);
if (EFI_ERROR (Status)) {
goto Exit;
}
}
Status = gBS->OpenProtocol (
Dns6Handle,
&gEfiDns6ProtocolGuid,
@@ -358,7 +358,7 @@ HttpDns6 (
//
// Name resolution is done, check result.
//
Status = Token.Status;
Status = Token.Status;
if (!EFI_ERROR (Status)) {
if (Token.RspData.H2AData == NULL) {
Status = EFI_DEVICE_ERROR;
@@ -374,7 +374,7 @@ HttpDns6 (
IP6_COPY_ADDRESS (IpAddress, Token.RspData.H2AData->IpList);
Status = EFI_SUCCESS;
}
Exit:
if (Token.Event != NULL) {
@@ -389,7 +389,7 @@ Exit:
if (Dns6 != NULL) {
Dns6->Configure (Dns6, NULL);
gBS->CloseProtocol (
Dns6Handle,
&gEfiDns6ProtocolGuid,
@@ -410,6 +410,6 @@ Exit:
if (DnsServerList != NULL) {
FreePool (DnsServerList);
}
return Status;
return Status;
}

View File

@@ -1,7 +1,7 @@
/** @file
The header file of routines for HttpDxe driver to perform DNS resolution based on UEFI DNS protocols.
Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, 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
which accompanies this distribution. The full text of the license may be found at
@@ -26,13 +26,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
@retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
@retval EFI_DEVICE_ERROR An unexpected network error occurred.
@retval Others Other errors as indicated.
**/
EFI_STATUS
HttpDns4 (
IN HTTP_PROTOCOL *HttpInstance,
IN CHAR16 *HostName,
OUT EFI_IPv4_ADDRESS *IpAddress
OUT EFI_IPv4_ADDRESS *IpAddress
);
/**
@@ -46,13 +46,13 @@ HttpDns4 (
@retval EFI_OUT_OF_RESOURCES Failed to allocate needed resources.
@retval EFI_DEVICE_ERROR An unexpected network error occurred.
@retval Others Other errors as indicated.
**/
EFI_STATUS
HttpDns6 (
IN HTTP_PROTOCOL *HttpInstance,
IN CHAR16 *HostName,
OUT EFI_IPv6_ADDRESS *IpAddress
OUT EFI_IPv6_ADDRESS *IpAddress
);
#endif
#endif

View File

@@ -1,7 +1,7 @@
/** @file
The driver binding and service binding protocol for HttpDxe driver.
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
This program and the accompanying materials
@@ -73,7 +73,7 @@ HttpCreateService (
HttpService->ControllerHandle = Controller;
HttpService->ChildrenNumber = 0;
InitializeListHead (&HttpService->ChildrenList);
*ServiceData = HttpService;
return EFI_SUCCESS;
}
@@ -91,8 +91,8 @@ HttpCleanService (
IN HTTP_SERVICE *HttpService,
IN BOOLEAN UsingIpv6
)
{
{
if (HttpService == NULL) {
return ;
}
@@ -104,14 +104,14 @@ HttpCleanService (
HttpService->Ip4DriverBindingHandle,
HttpService->ControllerHandle
);
NetLibDestroyServiceChild (
HttpService->ControllerHandle,
HttpService->Ip4DriverBindingHandle,
&gEfiTcp4ServiceBindingProtocolGuid,
HttpService->Tcp4ChildHandle
);
HttpService->Tcp4ChildHandle = NULL;
}
} else {
@@ -122,18 +122,18 @@ HttpCleanService (
HttpService->Ip6DriverBindingHandle,
HttpService->ControllerHandle
);
NetLibDestroyServiceChild (
HttpService->ControllerHandle,
HttpService->Ip6DriverBindingHandle,
&gEfiTcp6ServiceBindingProtocolGuid,
HttpService->Tcp6ChildHandle
);
HttpService->Tcp6ChildHandle = NULL;
}
}
}
/**
@@ -152,11 +152,11 @@ HttpUtilitiesInstalledCallback (
)
{
gBS->LocateProtocol (
&gEfiHttpUtilitiesProtocolGuid,
NULL,
&gEfiHttpUtilitiesProtocolGuid,
NULL,
(VOID **) &mHttpUtilities
);
//
// Close the event if Http utilities protocol is loacted.
//
@@ -183,13 +183,13 @@ HttpDxeDriverEntryPoint (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
{
EFI_STATUS Status;
VOID *Registration;
gBS->LocateProtocol (
&gEfiHttpUtilitiesProtocolGuid,
NULL,
&gEfiHttpUtilitiesProtocolGuid,
NULL,
(VOID **) &mHttpUtilities
);
@@ -246,7 +246,7 @@ HttpDxeDriverEntryPoint (
/**
Callback function which provided by user to remove one node in NetDestroyLinkList process.
@param[in] Entry The entry to be removed.
@param[in] Context Pointer to the callback context corresponds to the Context in NetDestroyLinkList.
@@ -292,7 +292,7 @@ HttpDestroyChildEntryInHandleBuffer (
@param[in] RemainingDevicePath Optional parameter used to pick a specific child
device to be started.
@param[in] IpVersion IP_VERSION_4 or IP_VERSION_6.
@retval EFI_SUCCESS This driver supports this device.
@retval EFI_UNSUPPORTED This driver does not support this device.
@@ -383,9 +383,9 @@ HttpDxeStart (
if (EFI_ERROR (Status)) {
return Status;
}
ASSERT (HttpService != NULL);
//
// Install the HttpServiceBinding Protocol onto Controller
//
@@ -395,7 +395,7 @@ HttpDxeStart (
&HttpService->ServiceBinding,
NULL
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
@@ -414,11 +414,11 @@ HttpDxeStart (
&gEfiTcp4ServiceBindingProtocolGuid,
&HttpService->Tcp4ChildHandle
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
Status = gBS->OpenProtocol (
HttpService->Tcp4ChildHandle,
&gEfiTcp4ProtocolGuid,
@@ -427,11 +427,11 @@ HttpDxeStart (
ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
} else {
return EFI_ALREADY_STARTED;
}
@@ -450,11 +450,11 @@ HttpDxeStart (
&gEfiTcp6ServiceBindingProtocolGuid,
&HttpService->Tcp6ChildHandle
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
Status = gBS->OpenProtocol (
HttpService->Tcp6ChildHandle,
&gEfiTcp6ProtocolGuid,
@@ -463,11 +463,11 @@ HttpDxeStart (
ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
} else {
return EFI_ALREADY_STARTED;
}
@@ -475,16 +475,16 @@ HttpDxeStart (
}
return EFI_SUCCESS;
ON_ERROR:
if (HttpService != NULL) {
HttpCleanService (HttpService, UsingIpv6);
if (HttpService->Tcp4ChildHandle == NULL && HttpService->Tcp6ChildHandle == NULL) {
FreePool (HttpService);
}
}
return Status;
@@ -551,9 +551,9 @@ HttpDxeStop (
);
if (!EFI_ERROR (Status)) {
HttpService = HTTP_SERVICE_FROM_PROTOCOL (ServiceBinding);
if (NumberOfChildren != 0) {
//
// Destroy the HTTP child instance in ChildHandleBuffer.
@@ -569,9 +569,9 @@ HttpDxeStop (
NULL
);
} else {
HttpCleanService (HttpService, UsingIpv6);
if (HttpService->Tcp4ChildHandle == NULL && HttpService->Tcp6ChildHandle == NULL) {
gBS->UninstallProtocolInterface (
NicHandle,
@@ -581,41 +581,41 @@ HttpDxeStop (
FreePool (HttpService);
}
Status = EFI_SUCCESS;
}
}
}
return Status;
}
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -650,28 +650,28 @@ HttpDxeIp4DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -700,10 +700,10 @@ HttpDxeIp4DriverBindingStart (
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -711,13 +711,13 @@ HttpDxeIp4DriverBindingStart (
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -743,33 +743,33 @@ HttpDxeIp4DriverBindingStop (
}
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -791,7 +791,7 @@ HttpDxeIp6DriverBindingSupported (
IN EFI_HANDLE ControllerHandle,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
)
{
{
return HttpDxeSupported (
This,
ControllerHandle,
@@ -805,28 +805,28 @@ HttpDxeIp6DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -855,10 +855,10 @@ HttpDxeIp6DriverBindingStart (
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -866,13 +866,13 @@ HttpDxeIp6DriverBindingStart (
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -936,7 +936,7 @@ HttpServiceBindingCreateChild (
if (HttpInstance == NULL) {
return EFI_OUT_OF_RESOURCES;
}
HttpInstance->Signature = HTTP_PROTOCOL_SIGNATURE;
HttpInstance->Service = HttpService;
HttpInstance->Method = HttpMethodMax;
@@ -972,9 +972,9 @@ HttpServiceBindingCreateChild (
gBS->RestoreTPL (OldTpl);
return EFI_SUCCESS;
ON_ERROR:
NetMapClean (&HttpInstance->TxTokens);
NetMapClean (&HttpInstance->RxTokens);
FreePool (HttpInstance);
@@ -1010,7 +1010,7 @@ HttpServiceBindingDestroyChild (
EFI_HTTP_PROTOCOL *Http;
EFI_STATUS Status;
EFI_TPL OldTpl;
if ((This == NULL) || (ChildHandle == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -1027,7 +1027,7 @@ HttpServiceBindingDestroyChild (
if (EFI_ERROR (Status)) {
return EFI_UNSUPPORTED;
}
HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (Http);
if (HttpInstance->Service != HttpService) {
return EFI_INVALID_PARAMETER;
@@ -1052,16 +1052,16 @@ HttpServiceBindingDestroyChild (
HttpInstance->InDestroy = FALSE;
return Status;
}
HttpCleanProtocol (HttpInstance);
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
RemoveEntryList (&HttpInstance->Link);
HttpService->ChildrenNumber--;
gBS->RestoreTPL (OldTpl);
FreePool (HttpInstance);
return EFI_SUCCESS;
}

View File

@@ -97,33 +97,33 @@ typedef struct {
} HTTP_DESTROY_CHILD_IN_HANDLE_BUF_CONTEXT;
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -150,28 +150,28 @@ HttpDxeIp4DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -191,10 +191,10 @@ HttpDxeIp4DriverBindingStart (
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -202,13 +202,13 @@ HttpDxeIp4DriverBindingStart (
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.
@@ -225,33 +225,33 @@ HttpDxeIp4DriverBindingStop (
);
/**
Tests to see if this driver supports a given controller. If a child device is provided,
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
This function checks to see if the driver specified by This supports the device specified by
ControllerHandle. Drivers will typically use the device path attached to
ControllerHandle and/or the services from the bus I/O abstraction attached to
ControllerHandle to determine if the driver supports ControllerHandle. This function
may be called many times during platform initialization. In order to reduce boot times, the tests
performed by this function must be very small, and take as little time as possible to execute. This
function must not change the state of any hardware devices, and this function must be aware that the
device specified by ControllerHandle may already be managed by the same driver or a
different driver. This function must match its calls to AllocatePages() with FreePages(),
AllocatePool() with FreePool(), and OpenProtocol() with CloseProtocol().
Because ControllerHandle may have been previously started by the same driver, if a protocol is
already in the opened state, then it must not be closed with CloseProtocol(). This is required
to guarantee the state of ControllerHandle is not modified by this function.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to test. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For bus drivers, if this parameter is not NULL, then
the bus driver must determine if the bus controller specified
by ControllerHandle and the child controller specified
by RemainingDevicePath are both supported by this
bus driver.
@retval EFI_SUCCESS The device specified by ControllerHandle and
@@ -278,28 +278,28 @@ HttpDxeIp6DriverBindingSupported (
Starts a device controller or a bus controller.
The Start() function is designed to be invoked from the EFI boot service ConnectController().
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
As a result, much of the error checking on the parameters to Start() has been moved into this
common boot service. It is legal to call Start() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE.
2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned
EFI_DEVICE_PATH_PROTOCOL.
3. Prior to calling Start(), the Supported() function for the driver specified by This must
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
@param[in] ControllerHandle The handle of the controller to start. This handle
must support a protocol interface that supplies
an I/O abstraction to the driver.
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
@param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
parameter is ignored by device drivers, and is optional for bus
drivers. For a bus driver, if this parameter is NULL, then handles
for all the children of Controller are created by this driver.
If this parameter is not NULL and the first Device Path Node is
not the End of Device Path Node, then only the handle for the
child device specified by the first Device Path Node of
RemainingDevicePath is created by this driver.
If the first Device Path Node of RemainingDevicePath is
If the first Device Path Node of RemainingDevicePath is
the End of Device Path Node, no child handle is created by this
driver.
@@ -320,10 +320,10 @@ HttpDxeIp6DriverBindingStart (
/**
Stops a device controller or a bus controller.
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
The Stop() function is designed to be invoked from the EFI boot service DisconnectController().
As a result, much of the error checking on the parameters to Stop() has been moved
into this common boot service. It is legal to call Stop() from other locations,
but the following calling restrictions must be followed, or the system behavior will not be deterministic.
1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this
same driver's Start() function.
@@ -331,13 +331,13 @@ HttpDxeIp6DriverBindingStart (
EFI_HANDLE. In addition, all of these handles must have been created in this driver's
Start() function, and the Start() function must have called OpenProtocol() on
ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.
@param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
@param[in] ControllerHandle A handle to the device being stopped. The handle must
support a bus specific I/O protocol for the driver
to use to stop the device.
@param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
@param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL
if NumberOfChildren is 0.
@retval EFI_SUCCESS The device was stopped.

View File

@@ -78,7 +78,7 @@
gEfiCertX509Guid ## SOMETIMES_CONSUMES ## GUID # Check the cert type
[Pcd]
gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections ## CONSUMES
gEfiNetworkPkgTokenSpaceGuid.PcdAllowHttpConnections ## CONSUMES
[UserExtensions.TianoCore."ExtraFiles"]
HttpDxeExtra.uni

View File

@@ -2,15 +2,15 @@
// UEFI HTTP DXE Driver.
//
// This driver provides UEFI 2.5 HTTP protocols. It could work with an IPv4 or IPv6 stack.
//
//
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
//
// Copyright (c) 2015 - 2018, 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
// which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php.
//
//
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//

View File

@@ -1,7 +1,7 @@
// /** @file
// HttpDxe Localized Strings and Content
//
// Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
// Copyright (c) 2015 - 2018, 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
@@ -13,8 +13,8 @@
//
// **/
#string STR_PROPERTIES_MODULE_NAME
#language en-US
#string STR_PROPERTIES_MODULE_NAME
#language en-US
"UEFI HTTP DXE"

View File

@@ -33,17 +33,17 @@ EFI_HTTP_PROTOCOL mEfiHttpTemplate = {
@param[in] This Pointer to EFI_HTTP_PROTOCOL instance.
@param[out] HttpConfigData Point to buffer for operational parameters of this
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.
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.
HttpConfigData->AccessPoint.IPv4Node or
HttpConfigData->AccessPoint.IPv4Node or
HttpConfigData->AccessPoint.IPv6Node is NULL.
@retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been started.
@@ -132,16 +132,16 @@ EFIAPI
EfiHttpConfigure (
IN EFI_HTTP_PROTOCOL *This,
IN EFI_HTTP_CONFIG_DATA *HttpConfigData OPTIONAL
)
)
{
HTTP_PROTOCOL *HttpInstance;
EFI_STATUS Status;
//
// Check input parameters.
//
if (This == NULL ||
(HttpConfigData != NULL &&
(HttpConfigData != NULL &&
((HttpConfigData->LocalAddressIsIPv6 && HttpConfigData->AccessPoint.IPv6Node == NULL) ||
(!HttpConfigData->LocalAddressIsIPv6 && HttpConfigData->AccessPoint.IPv4Node == NULL)))) {
return EFI_INVALID_PARAMETER;
@@ -166,8 +166,8 @@ EfiHttpConfigure (
HttpInstance->HttpVersion = HttpConfigData->HttpVersion;
HttpInstance->TimeOutMillisec = HttpConfigData->TimeOutMillisec;
HttpInstance->LocalAddressIsIPv6 = HttpConfigData->LocalAddressIsIPv6;
if (HttpConfigData->LocalAddressIsIPv6) {
if (HttpConfigData->LocalAddressIsIPv6) {
CopyMem (
&HttpInstance->Ipv6Node,
HttpConfigData->AccessPoint.IPv6Node,
@@ -180,7 +180,7 @@ EfiHttpConfigure (
sizeof (HttpInstance->IPv4Node)
);
}
//
// Creat Tcp child
//
@@ -188,7 +188,7 @@ EfiHttpConfigure (
if (EFI_ERROR (Status)) {
return Status;
}
HttpInstance->State = HTTP_STATE_HTTP_CONFIGED;
return EFI_SUCCESS;
@@ -201,7 +201,7 @@ EfiHttpConfigure (
return EFI_SUCCESS;
}
}
/**
The Request() function queues an HTTP request to this HTTP instance.
@@ -284,8 +284,8 @@ EfiHttpRequest (
// Only support GET, HEAD, DELETE, PATCH, PUT and POST method in current implementation.
//
if ((Request != NULL) && (Request->Method != HttpMethodGet) &&
(Request->Method != HttpMethodHead) && (Request->Method != HttpMethodDelete) &&
(Request->Method != HttpMethodPut) && (Request->Method != HttpMethodPost) &&
(Request->Method != HttpMethodHead) && (Request->Method != HttpMethodDelete) &&
(Request->Method != HttpMethodPut) && (Request->Method != HttpMethodPost) &&
(Request->Method != HttpMethodPatch)) {
return EFI_UNSUPPORTED;
}
@@ -307,8 +307,8 @@ EfiHttpRequest (
//
// Request would be NULL only for PUT/POST/PATCH operation (in the current implementation)
//
if ((HttpInstance->Method != HttpMethodPut) &&
(HttpInstance->Method != HttpMethodPost) &&
if ((HttpInstance->Method != HttpMethodPut) &&
(HttpInstance->Method != HttpMethodPost) &&
(HttpInstance->Method != HttpMethodPatch)) {
return EFI_INVALID_PARAMETER;
}
@@ -358,7 +358,7 @@ EfiHttpRequest (
UnicodeStrToAsciiStrS (Request->Url, Url, UrlLen);
//
// From the information in Url, the HTTP instance will
// From the information in Url, the HTTP instance will
// be able to determine whether to use http or https.
//
HttpInstance->UseHttps = IsHttpsUrl (Url);
@@ -367,7 +367,7 @@ EfiHttpRequest (
// HTTP is disabled, return directly if the URI is not HTTPS.
//
if (!PcdGetBool (PcdAllowHttpConnections) && !(HttpInstance->UseHttps)) {
DEBUG ((EFI_D_ERROR, "EfiHttpRequest: HTTP is disabled.\n"));
return EFI_ACCESS_DENIED;
@@ -434,9 +434,9 @@ EfiHttpRequest (
ReConfigure = FALSE;
} else {
if ((HttpInstance->RemotePort == RemotePort) &&
(AsciiStrCmp (HttpInstance->RemoteHost, HostName) == 0) &&
(!HttpInstance->UseHttps || (HttpInstance->UseHttps &&
!TlsConfigure &&
(AsciiStrCmp (HttpInstance->RemoteHost, HostName) == 0) &&
(!HttpInstance->UseHttps || (HttpInstance->UseHttps &&
!TlsConfigure &&
HttpInstance->TlsSessionState == EfiTlsSessionDataTransferring))) {
//
// Host Name and port number of the request URL are the same with previous call to Request().
@@ -495,7 +495,7 @@ EfiHttpRequest (
}
}
}
}
}
if (Configure) {
//
@@ -514,14 +514,14 @@ EfiHttpRequest (
Status = EFI_OUT_OF_RESOURCES;
goto Error1;
}
AsciiStrToUnicodeStrS (HostName, HostNameStr, HostNameSize);
if (!HttpInstance->LocalAddressIsIPv6) {
Status = HttpDns4 (HttpInstance, HostNameStr, &HttpInstance->RemoteAddr);
} else {
Status = HttpDns6 (HttpInstance, HostNameStr, &HttpInstance->RemoteIpv6Addr);
}
FreePool (HostNameStr);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Error: Could not retrieve the host address from DNS server.\n"));
@@ -553,10 +553,10 @@ EfiHttpRequest (
if (EFI_ERROR (Status)) {
goto Error1;
}
TlsCloseTxRxEvent (HttpInstance);
}
HttpCloseConnection (HttpInstance);
EfiHttpCancel (This, NULL);
}
@@ -575,11 +575,11 @@ EfiHttpRequest (
if (Request != NULL) {
Wrap->TcpWrap.Method = Request->Method;
}
Status = HttpInitSession (
HttpInstance,
Wrap,
Configure || ReConfigure,
HttpInstance,
Wrap,
Configure || ReConfigure,
TlsConfigure
);
if (EFI_ERROR (Status)) {
@@ -588,14 +588,14 @@ EfiHttpRequest (
if (!Configure && !ReConfigure && !TlsConfigure) {
//
// For the new HTTP token, create TX TCP token events.
// For the new HTTP token, create TX TCP token events.
//
Status = HttpCreateTcpTxEvent (Wrap);
if (EFI_ERROR (Status)) {
goto Error1;
}
}
//
// Create request message.
//
@@ -647,11 +647,11 @@ EfiHttpRequest (
RequestMsgSize
);
if (EFI_ERROR (Status)) {
goto Error5;
goto Error5;
}
DispatchDpc ();
if (HostName != NULL) {
FreePool (HostName);
}
@@ -659,7 +659,7 @@ EfiHttpRequest (
if (UrlParser != NULL) {
HttpUrlFreeParser (UrlParser);
}
return EFI_SUCCESS;
Error5:
@@ -674,7 +674,7 @@ Error5:
Error4:
if (RequestMsg != NULL) {
FreePool (RequestMsg);
}
}
Error3:
if (HttpInstance->UseHttps) {
@@ -684,7 +684,7 @@ Error3:
Error2:
HttpCloseConnection (HttpInstance);
HttpCloseTcpConnCloseEvent (HttpInstance);
if (NULL != Wrap->TcpWrap.Tx4Token.CompletionToken.Event) {
gBS->CloseEvent (Wrap->TcpWrap.Tx4Token.CompletionToken.Event);
@@ -707,12 +707,12 @@ Error1:
}
return Status;
}
/**
Cancel a user's Token.
Cancel a user's Token.
@param[in] Map The HTTP instance's token queue.
@param[in] Item Object container for one HTTP token and token's wrap.
@param[in] Context The user's token to cancel.
@@ -746,7 +746,7 @@ HttpCancelTokens (
Wrap = (HTTP_TOKEN_WRAP *) Item->Value;
ASSERT (Wrap != NULL);
HttpInstance = Wrap->HttpInstance;
if (!HttpInstance->LocalAddressIsIPv6) {
if (Wrap->TcpWrap.Rx4Token.CompletionToken.Event != NULL) {
//
@@ -781,7 +781,7 @@ HttpCancelTokens (
return EFI_ABORTED;
}
return EFI_SUCCESS;
return EFI_SUCCESS;
}
/**
@@ -794,7 +794,7 @@ HttpCancelTokens (
cancelled.
@retval EFI_SUCCESS The token is cancelled.
@retval EFI_NOT_FOUND The asynchronous request or response token is not found.
@retval EFI_NOT_FOUND The asynchronous request or response token is not found.
@retval Others Other error as indicated.
**/
@@ -814,7 +814,7 @@ HttpCancel (
if (Token != NULL) {
if (Status == EFI_ABORTED) {
return EFI_SUCCESS;
}
}
} else {
return Status;
}
@@ -843,7 +843,7 @@ HttpCancel (
HttpInstance->Tcp6->Cancel (HttpInstance->Tcp6, &HttpInstance->Tcp6TlsRxToken.CompletionToken);
}
}
return EFI_SUCCESS;
}
@@ -936,7 +936,7 @@ HttpBodyParserCallback (
} else {
Wrap->HttpInstance->NextMsg = NULL;
}
//
// Free Tx4Token or Tx6Token since already received corrsponding HTTP response.
@@ -953,7 +953,7 @@ HttpBodyParserCallback (
@retval EFI_SUCCESS Allocation succeeded.
@retval EFI_OUT_OF_RESOURCES Failed to complete the opration due to lack of resources.
@retval EFI_NOT_READY Can't find a corresponding Tx4Token/Tx6Token or
@retval EFI_NOT_READY Can't find a corresponding Tx4Token/Tx6Token or
the EFI_HTTP_UTILITIES_PROTOCOL is not available.
**/
@@ -983,7 +983,7 @@ HttpResponseWorker (
if (Wrap == NULL || Wrap->HttpInstance == NULL) {
return EFI_INVALID_PARAMETER;
}
HttpInstance = Wrap->HttpInstance;
Token = Wrap->HttpToken;
HttpMsg = Token->Message;
@@ -998,7 +998,7 @@ HttpResponseWorker (
ValueInItem = NULL;
Fragment.Len = 0;
Fragment.Bulk = NULL;
if (HttpMsg->Data.Response != NULL) {
//
// Check whether we have cached header from previous call.
@@ -1025,8 +1025,8 @@ HttpResponseWorker (
//
// Check whether we cached the whole HTTP headers.
//
EndofHeader = AsciiStrStr (HttpHeaders, HTTP_END_OF_HDR_STR);
}
EndofHeader = AsciiStrStr (HttpHeaders, HTTP_END_OF_HDR_STR);
}
HttpInstance->EndofHeader = &EndofHeader;
HttpInstance->HttpHeaders = &HttpHeaders;
@@ -1239,7 +1239,7 @@ HttpResponseWorker (
//
// We have a cached HTTP message which includes a part of HTTP header of next message.
//
BodyLen = HttpInstance->NextMsg - (HttpInstance->CacheBody + HttpInstance->CacheOffset);
BodyLen = HttpInstance->NextMsg - (HttpInstance->CacheBody + HttpInstance->CacheOffset);
} else {
BodyLen = HttpInstance->CacheLen - HttpInstance->CacheOffset;
}
@@ -1274,7 +1274,7 @@ HttpResponseWorker (
//
Status = EFI_SUCCESS;
goto Exit;
}
}
if (BodyLen == 0 && HttpInstance->MsgParser == NULL) {
//
@@ -1282,8 +1282,8 @@ HttpResponseWorker (
//
HttpMsg->BodyLength = 0;
Status = EFI_SUCCESS;
goto Exit;
}
goto Exit;
}
}
ASSERT (HttpInstance->MsgParser != NULL);
@@ -1297,7 +1297,7 @@ HttpResponseWorker (
if (EFI_ERROR (Status)) {
goto Error2;
}
} else {
if (HttpInstance->TimeoutEvent == NULL) {
//
@@ -1322,11 +1322,11 @@ HttpResponseWorker (
if (EFI_ERROR (Status)) {
goto Error2;
}
Status = HttpsReceive (HttpInstance, &Fragment, HttpInstance->TimeoutEvent);
gBS->SetTimer (HttpInstance->TimeoutEvent, TimerCancel, 0);
if (EFI_ERROR (Status)) {
goto Error2;
}
@@ -1357,19 +1357,19 @@ HttpResponseWorker (
if (HttpInstance->NextMsg != NULL) {
HttpMsg->BodyLength = MIN ((UINTN) HttpInstance->NextMsg - (UINTN) Fragment.Bulk, HttpMsg->BodyLength);
CopyMem (HttpMsg->Body, Fragment.Bulk, HttpMsg->BodyLength);
HttpInstance->CacheLen = Fragment.Len - HttpMsg->BodyLength;
if (HttpInstance->CacheLen != 0) {
if (HttpInstance->CacheBody != NULL) {
FreePool (HttpInstance->CacheBody);
}
HttpInstance->CacheBody = AllocateZeroPool (HttpInstance->CacheLen);
if (HttpInstance->CacheBody == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto Error2;
}
CopyMem (HttpInstance->CacheBody, Fragment.Bulk + HttpMsg->BodyLength, HttpInstance->CacheLen);
HttpInstance->CacheOffset = 0;
@@ -1383,7 +1383,7 @@ HttpResponseWorker (
if (HttpInstance->CacheBody != NULL) {
FreePool (HttpInstance->CacheBody);
}
HttpInstance->CacheBody = AllocateZeroPool (HttpInstance->CacheLen);
if (HttpInstance->CacheBody == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -1438,7 +1438,7 @@ Error:
} else {
FreePool (Wrap);
}
if (HttpHeaders != NULL) {
FreePool (HttpHeaders);
HttpHeaders = NULL;
@@ -1467,7 +1467,7 @@ Error:
gBS->SignalEvent (Token->Event);
return Status;
return Status;
}
@@ -1539,7 +1539,7 @@ EfiHttpResponse (
if (HttpMsg == NULL) {
return EFI_INVALID_PARAMETER;
}
HttpInstance = HTTP_INSTANCE_FROM_PROTOCOL (This);
if (HttpInstance->State != HTTP_STATE_TCP_CONNECTED) {
@@ -1550,7 +1550,7 @@ EfiHttpResponse (
// Check whether the token already existed.
//
if (EFI_ERROR (NetMapIterate (&HttpInstance->RxTokens, HttpTokenExist, Token))) {
return EFI_ACCESS_DENIED;
return EFI_ACCESS_DENIED;
}
Wrap = AllocateZeroPool (sizeof (HTTP_TOKEN_WRAP));
@@ -1562,8 +1562,8 @@ EfiHttpResponse (
Wrap->HttpToken = Token;
//
// Notes: For Https, receive token wrapped in HTTP_TOKEN_WRAP is not used to
// receive the https response. A special TlsRxToken is used for receiving TLS
// Notes: For Https, receive token wrapped in HTTP_TOKEN_WRAP is not used to
// receive the https response. A special TlsRxToken is used for receiving TLS
// related messages. It should be a blocking response.
//
if (!HttpInstance->UseHttps) {
@@ -1597,9 +1597,9 @@ Error:
gBS->CloseEvent (Wrap->TcpWrap.Rx6Token.CompletionToken.Event);
}
FreePool (Wrap);
}
}
return Status;
return Status;
}
/**
@@ -1640,7 +1640,7 @@ EfiHttpPoll (
if (HttpInstance->State != HTTP_STATE_TCP_CONNECTED) {
return EFI_NOT_STARTED;
}
if (HttpInstance->LocalAddressIsIPv6) {
if (HttpInstance->Tcp6 == NULL) {
return EFI_NOT_STARTED;
@@ -1652,8 +1652,8 @@ EfiHttpPoll (
}
Status = HttpInstance->Tcp4->Poll (HttpInstance->Tcp4);
}
DispatchDpc ();
return Status;
}

View File

@@ -1,8 +1,8 @@
/** @file
The header files of implementation of EFI_HTTP_PROTOCOL protocol interfaces.
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
Copyright (c) 2015 - 2018, 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
@@ -33,17 +33,17 @@
@param[in] This Pointer to EFI_HTTP_PROTOCOL instance.
@param[out] HttpConfigData Point to buffer for operational parameters of this
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
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.
HttpConfigData->AccessPoint.IPv4Node or
HttpConfigData->AccessPoint.IPv4Node or
HttpConfigData->AccessPoint.IPv6Node is NULL.
@retval EFI_NOT_STARTED This EFI HTTP Protocol instance has not been started.
@@ -65,7 +65,7 @@ EfiHttpGetModeData (
connections with remote hosts, canceling all asynchronous tokens, and flush request
and response buffers without informing the appropriate hosts.
No other EFI HTTP function can be executed by this instance until the Configure()
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.

View File

@@ -16,7 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "HttpDriver.h"
/**
The common notify function used in HTTP driver.
The common notify function used in HTTP driver.
@param[in] Event The event signaled.
@param[in] Context The context.
@@ -54,10 +54,10 @@ HttpTcpTransmitNotifyDpc (
if (Context == NULL) {
return ;
}
Wrap = (HTTP_TOKEN_WRAP *) Context;
HttpInstance = Wrap->HttpInstance;
if (!HttpInstance->LocalAddressIsIPv6) {
Wrap->HttpToken->Status = Wrap->TcpWrap.Tx4Token.CompletionToken.Status;
gBS->SignalEvent (Wrap->HttpToken->Event);
@@ -72,11 +72,11 @@ HttpTcpTransmitNotifyDpc (
if (Wrap->TcpWrap.Tx4Token.CompletionToken.Event != NULL) {
gBS->CloseEvent (Wrap->TcpWrap.Tx4Token.CompletionToken.Event);
}
} else {
Wrap->HttpToken->Status = Wrap->TcpWrap.Tx6Token.CompletionToken.Status;
gBS->SignalEvent (Wrap->HttpToken->Event);
//
// Free resources.
//
@@ -86,7 +86,7 @@ HttpTcpTransmitNotifyDpc (
if (Wrap->TcpWrap.Tx6Token.CompletionToken.Event != NULL) {
gBS->CloseEvent (Wrap->TcpWrap.Tx6Token.CompletionToken.Event);
}
}
}
@@ -145,11 +145,11 @@ HttpTcpReceiveNotifyDpc (
Wrap = (HTTP_TOKEN_WRAP *) Context;
HttpInstance = Wrap->HttpInstance;
UsingIpv6 = HttpInstance->LocalAddressIsIPv6;
if (UsingIpv6) {
gBS->CloseEvent (Wrap->TcpWrap.Rx6Token.CompletionToken.Event);
Wrap->TcpWrap.Rx6Token.CompletionToken.Event = NULL;
if (EFI_ERROR (Wrap->TcpWrap.Rx6Token.CompletionToken.Status)) {
DEBUG ((EFI_D_ERROR, "HttpTcpReceiveNotifyDpc: %r!\n", Wrap->TcpWrap.Rx6Token.CompletionToken.Status));
Wrap->HttpToken->Status = Wrap->TcpWrap.Rx6Token.CompletionToken.Status;
@@ -159,30 +159,30 @@ HttpTcpReceiveNotifyDpc (
if (Item != NULL) {
NetMapRemoveItem (&HttpInstance->RxTokens, Item, NULL);
}
FreePool (Wrap);
Wrap = NULL;
return ;
}
} else {
gBS->CloseEvent (Wrap->TcpWrap.Rx4Token.CompletionToken.Event);
Wrap->TcpWrap.Rx4Token.CompletionToken.Event = NULL;
if (EFI_ERROR (Wrap->TcpWrap.Rx4Token.CompletionToken.Status)) {
DEBUG ((EFI_D_ERROR, "HttpTcpReceiveNotifyDpc: %r!\n", Wrap->TcpWrap.Rx4Token.CompletionToken.Status));
Wrap->HttpToken->Status = Wrap->TcpWrap.Rx4Token.CompletionToken.Status;
gBS->SignalEvent (Wrap->HttpToken->Event);
Item = NetMapFindKey (&HttpInstance->RxTokens, Wrap->HttpToken);
if (Item != NULL) {
NetMapRemoveItem (&HttpInstance->RxTokens, Item, NULL);
}
FreePool (Wrap);
Wrap = NULL;
return ;
}
}
@@ -220,7 +220,7 @@ HttpTcpReceiveNotifyDpc (
// We receive part of header of next HTTP msg.
//
if (HttpInstance->NextMsg != NULL) {
Wrap->HttpToken->Message->BodyLength = HttpInstance->NextMsg -
Wrap->HttpToken->Message->BodyLength = HttpInstance->NextMsg -
(CHAR8 *) Wrap->HttpToken->Message->Body;
HttpInstance->CacheLen = Length - Wrap->HttpToken->Message->BodyLength;
if (HttpInstance->CacheLen != 0) {
@@ -246,7 +246,7 @@ HttpTcpReceiveNotifyDpc (
} else {
Wrap->HttpToken->Status = Wrap->TcpWrap.Rx4Token.CompletionToken.Status;
}
gBS->SignalEvent (Wrap->HttpToken->Event);
@@ -323,7 +323,7 @@ HttpCreateTcpConnCloseEvent (
if (EFI_ERROR (Status)) {
goto ERROR;
}
} else {
//
// Create events for variuos asynchronous operations.
@@ -353,7 +353,7 @@ HttpCreateTcpConnCloseEvent (
goto ERROR;
}
}
return EFI_SUCCESS;
ERROR:
@@ -401,7 +401,7 @@ HttpCloseTcpConnCloseEvent (
HttpInstance->Tcp4CloseToken.CompletionToken.Event = NULL;
}
}
}
/**
@@ -436,7 +436,7 @@ HttpCreateTcpTxEvent (
if (EFI_ERROR (Status)) {
return Status;
}
TcpWrap->Tx4Data.Push = TRUE;
TcpWrap->Tx4Data.Urgent = FALSE;
TcpWrap->Tx4Data.FragmentCount = 1;
@@ -460,9 +460,9 @@ HttpCreateTcpTxEvent (
TcpWrap->Tx6Data.FragmentCount = 1;
TcpWrap->Tx6Token.Packet.TxData = &Wrap->TcpWrap.Tx6Data;
TcpWrap->Tx6Token.CompletionToken.Status =EFI_NOT_READY;
}
return EFI_SUCCESS;
}
@@ -493,7 +493,7 @@ HttpCreateTcpRxEventForHeader (
if (EFI_ERROR (Status)) {
return Status;
}
HttpInstance->Rx4Data.FragmentCount = 1;
HttpInstance->Rx4Token.Packet.RxData = &HttpInstance->Rx4Data;
HttpInstance->Rx4Token.CompletionToken.Status = EFI_NOT_READY;
@@ -513,7 +513,7 @@ HttpCreateTcpRxEventForHeader (
HttpInstance->Rx6Data.FragmentCount =1;
HttpInstance->Rx6Token.Packet.RxData = &HttpInstance->Rx6Data;
HttpInstance->Rx6Token.CompletionToken.Status = EFI_NOT_READY;
}
@@ -531,7 +531,7 @@ HttpCreateTcpRxEventForHeader (
**/
EFI_STATUS
HttpCreateTcpRxEvent (
IN HTTP_TOKEN_WRAP *Wrap
IN HTTP_TOKEN_WRAP *Wrap
)
{
EFI_STATUS Status;
@@ -551,7 +551,7 @@ HttpCreateTcpRxEvent (
if (EFI_ERROR (Status)) {
return Status;
}
TcpWrap->Rx4Data.FragmentCount = 1;
TcpWrap->Rx4Token.Packet.RxData = &Wrap->TcpWrap.Rx4Data;
TcpWrap->Rx4Token.CompletionToken.Status = EFI_NOT_READY;
@@ -563,7 +563,7 @@ HttpCreateTcpRxEvent (
HttpTcpReceiveNotify,
Wrap,
&TcpWrap->Rx6Token.CompletionToken.Event
);
);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -572,7 +572,7 @@ HttpCreateTcpRxEvent (
TcpWrap->Rx6Token.Packet.RxData = &Wrap->TcpWrap.Rx6Data;
TcpWrap->Rx6Token.CompletionToken.Status = EFI_NOT_READY;
}
return EFI_SUCCESS;
}
@@ -580,7 +580,7 @@ HttpCreateTcpRxEvent (
Close Events for Tcp Receive Tokens for HTTP body and HTTP header.
@param[in] Wrap Pointer to HTTP token's wrap data.
**/
VOID
HttpCloseTcpRxEvent (
@@ -591,7 +591,7 @@ HttpCloseTcpRxEvent (
ASSERT (Wrap != NULL);
HttpInstance = Wrap->HttpInstance;
if (HttpInstance->LocalAddressIsIPv6) {
if (Wrap->TcpWrap.Rx6Token.CompletionToken.Event != NULL) {
gBS->CloseEvent (Wrap->TcpWrap.Rx6Token.CompletionToken.Event);
@@ -605,7 +605,7 @@ HttpCloseTcpRxEvent (
if (Wrap->TcpWrap.Rx4Token.CompletionToken.Event != NULL) {
gBS->CloseEvent (Wrap->TcpWrap.Rx4Token.CompletionToken.Event);
}
if (HttpInstance->Rx4Token.CompletionToken.Event != NULL) {
gBS->CloseEvent (HttpInstance->Rx4Token.CompletionToken.Event);
HttpInstance->Rx4Token.CompletionToken.Event = NULL;
@@ -619,7 +619,7 @@ HttpCloseTcpRxEvent (
@param[in, out] HttpInstance Pointer to HTTP_PROTOCOL structure.
@param[in] IpVersion Indicate us TCP4 protocol or TCP6 protocol.
@retval EFI_SUCCESS HTTP_PROTOCOL structure is initialized successfully.
@retval EFI_SUCCESS HTTP_PROTOCOL structure is initialized successfully.
@retval Others Other error as indicated.
**/
@@ -632,10 +632,10 @@ HttpInitProtocol (
EFI_STATUS Status;
VOID *Interface;
BOOLEAN UsingIpv6;
ASSERT (HttpInstance != NULL);
UsingIpv6 = IpVersion;
if (!UsingIpv6) {
//
// Create TCP4 child.
@@ -659,7 +659,7 @@ HttpInitProtocol (
HttpInstance->Service->ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
@@ -710,7 +710,7 @@ HttpInitProtocol (
HttpInstance->Service->ControllerHandle,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
@@ -723,10 +723,10 @@ HttpInitProtocol (
HttpInstance->Handle,
EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
);
if (EFI_ERROR(Status)) {
goto ON_ERROR;
}
}
Status = gBS->OpenProtocol (
HttpInstance->Service->Tcp6ChildHandle,
@@ -741,7 +741,7 @@ HttpInitProtocol (
goto ON_ERROR;
}
}
HttpInstance->Url = AllocateZeroPool (HTTP_URL_BUFFER_LEN);
if (HttpInstance->Url == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -751,7 +751,7 @@ HttpInitProtocol (
return EFI_SUCCESS;
ON_ERROR:
if (HttpInstance->Tcp4ChildHandle != NULL) {
gBS->CloseProtocol (
HttpInstance->Tcp4ChildHandle,
@@ -765,8 +765,8 @@ ON_ERROR:
&gEfiTcp4ProtocolGuid,
HttpInstance->Service->Ip4DriverBindingHandle,
HttpInstance->Handle
);
);
NetLibDestroyServiceChild (
HttpInstance->Service->ControllerHandle,
HttpInstance->Service->Ip4DriverBindingHandle,
@@ -774,7 +774,7 @@ ON_ERROR:
HttpInstance->Tcp4ChildHandle
);
}
if (HttpInstance->Service->Tcp4ChildHandle != NULL) {
gBS->CloseProtocol (
HttpInstance->Service->Tcp4ChildHandle,
@@ -783,7 +783,7 @@ ON_ERROR:
HttpInstance->Handle
);
}
if (HttpInstance->Tcp6ChildHandle != NULL) {
gBS->CloseProtocol (
HttpInstance->Tcp6ChildHandle,
@@ -798,7 +798,7 @@ ON_ERROR:
HttpInstance->Service->Ip6DriverBindingHandle,
HttpInstance->Handle
);
NetLibDestroyServiceChild (
HttpInstance->Service->ControllerHandle,
HttpInstance->Service->Ip6DriverBindingHandle,
@@ -806,7 +806,7 @@ ON_ERROR:
HttpInstance->Tcp6ChildHandle
);
}
if (HttpInstance->Service->Tcp6ChildHandle != NULL) {
gBS->CloseProtocol (
HttpInstance->Service->Tcp6ChildHandle,
@@ -817,7 +817,7 @@ ON_ERROR:
}
return EFI_UNSUPPORTED;
}
/**
@@ -832,7 +832,7 @@ HttpCleanProtocol (
)
{
HttpCloseConnection (HttpInstance);
HttpCloseTcpConnCloseEvent (HttpInstance);
if (HttpInstance->TimeoutEvent != NULL) {
@@ -855,18 +855,18 @@ HttpCleanProtocol (
HttpFreeMsgParser (HttpInstance->MsgParser);
HttpInstance->MsgParser = NULL;
}
if (HttpInstance->Url != NULL) {
FreePool (HttpInstance->Url);
HttpInstance->Url = NULL;
}
NetMapClean (&HttpInstance->TxTokens);
NetMapClean (&HttpInstance->RxTokens);
if (HttpInstance->TlsSb != NULL && HttpInstance->TlsChildHandle != NULL) {
//
// Destroy the TLS instance.
// Destroy the TLS instance.
//
HttpInstance->TlsSb->DestroyChild (HttpInstance->TlsSb, HttpInstance->TlsChildHandle);
}
@@ -885,7 +885,7 @@ HttpCleanProtocol (
HttpInstance->Service->Ip4DriverBindingHandle,
HttpInstance->Handle
);
NetLibDestroyServiceChild (
HttpInstance->Service->ControllerHandle,
HttpInstance->Service->Ip4DriverBindingHandle,
@@ -901,7 +901,7 @@ HttpCleanProtocol (
HttpInstance->Service->Ip4DriverBindingHandle,
HttpInstance->Handle
);
}
}
if (HttpInstance->Tcp6ChildHandle != NULL) {
gBS->CloseProtocol (
@@ -917,7 +917,7 @@ HttpCleanProtocol (
HttpInstance->Service->Ip6DriverBindingHandle,
HttpInstance->Handle
);
NetLibDestroyServiceChild (
HttpInstance->Service->ControllerHandle,
HttpInstance->Service->Ip6DriverBindingHandle,
@@ -925,7 +925,7 @@ HttpCleanProtocol (
HttpInstance->Tcp6ChildHandle
);
}
if (HttpInstance->Service->Tcp6ChildHandle != NULL) {
gBS->CloseProtocol (
HttpInstance->Service->Tcp6ChildHandle,
@@ -935,7 +935,7 @@ HttpCleanProtocol (
);
}
TlsCloseTxRxEvent (HttpInstance);
TlsCloseTxRxEvent (HttpInstance);
}
/**
@@ -965,13 +965,13 @@ HttpCreateConnection (
DEBUG ((EFI_D_ERROR, "HttpCreateConnection: Tcp4->Connect() = %r\n", Status));
return Status;
}
while (!HttpInstance->IsTcp4ConnDone) {
HttpInstance->Tcp4->Poll (HttpInstance->Tcp4);
}
Status = HttpInstance->Tcp4ConnToken.CompletionToken.Status;
} else {
HttpInstance->IsTcp6ConnDone = FALSE;
HttpInstance->Tcp6ConnToken.CompletionToken.Status = EFI_NOT_READY;
@@ -985,9 +985,9 @@ HttpCreateConnection (
HttpInstance->Tcp6->Poll (HttpInstance->Tcp6);
}
Status = HttpInstance->Tcp6ConnToken.CompletionToken.Status;
Status = HttpInstance->Tcp6ConnToken.CompletionToken.Status;
}
if (!EFI_ERROR (Status)) {
HttpInstance->State = HTTP_STATE_TCP_CONNECTED;
}
@@ -1024,7 +1024,7 @@ HttpCloseConnection (
while (!HttpInstance->IsTcp6CloseDone) {
HttpInstance->Tcp6->Poll (HttpInstance->Tcp6);
}
} else {
HttpInstance->Tcp4CloseToken.AbortOnClose = TRUE;
HttpInstance->IsTcp4CloseDone = FALSE;
@@ -1070,7 +1070,7 @@ HttpConfigureTcp4 (
Tcp4CfgData = &HttpInstance->Tcp4CfgData;
ZeroMem (Tcp4CfgData, sizeof (EFI_TCP4_CONFIG_DATA));
Tcp4CfgData->TypeOfService = HTTP_TOS_DEAULT;
Tcp4CfgData->TimeToLive = HTTP_TTL_DEAULT;
Tcp4CfgData->ControlOption = &HttpInstance->Tcp4Option;
@@ -1081,7 +1081,7 @@ HttpConfigureTcp4 (
IP4_COPY_ADDRESS (&Tcp4AP->StationAddress, &HttpInstance->IPv4Node.LocalAddress);
IP4_COPY_ADDRESS (&Tcp4AP->SubnetMask, &HttpInstance->IPv4Node.LocalSubnet);
}
Tcp4AP->StationPort = HttpInstance->IPv4Node.LocalPort;
Tcp4AP->RemotePort = HttpInstance->RemotePort;
Tcp4AP->ActiveFlag = TRUE;
@@ -1141,16 +1141,16 @@ HttpConfigureTcp6 (
EFI_TCP6_CONFIG_DATA *Tcp6CfgData;
EFI_TCP6_ACCESS_POINT *Tcp6Ap;
EFI_TCP6_OPTION *Tcp6Option;
ASSERT (HttpInstance != NULL);
Tcp6CfgData = &HttpInstance->Tcp6CfgData;
ZeroMem (Tcp6CfgData, sizeof (EFI_TCP6_CONFIG_DATA));
Tcp6CfgData->TrafficClass = 0;
Tcp6CfgData->HopLimit = 255;
Tcp6CfgData->ControlOption = &HttpInstance->Tcp6Option;
Tcp6Ap = &Tcp6CfgData->AccessPoint;
Tcp6Ap->ActiveFlag = TRUE;
Tcp6Ap->StationPort = HttpInstance->Ipv6Node.LocalPort;
@@ -1175,7 +1175,7 @@ HttpConfigureTcp6 (
DEBUG ((EFI_D_ERROR, "HttpConfigureTcp6 - %r\n", Status));
return Status;
}
Status = HttpCreateTcpConnCloseEvent (HttpInstance);
if (EFI_ERROR (Status)) {
return Status;
@@ -1189,11 +1189,11 @@ HttpConfigureTcp6 (
HttpInstance->State = HTTP_STATE_TCP_CONFIGED;
return EFI_SUCCESS;
}
/**
Check existing TCP connection, if in error state, recover TCP4 connection. Then,
Check existing TCP connection, if in error state, recover TCP4 connection. Then,
connect one TLS session if required.
@param[in] HttpInstance The HTTP instance private data.
@@ -1217,8 +1217,8 @@ HttpConnectTcp4 (
}
Status = HttpInstance->Tcp4->GetModeData(
HttpInstance->Tcp4,
&Tcp4State,
HttpInstance->Tcp4,
&Tcp4State,
NULL,
NULL,
NULL,
@@ -1240,7 +1240,7 @@ HttpConnectTcp4 (
DEBUG ((EFI_D_ERROR, "Tcp4 Connection fail - %x\n", Status));
return Status;
}
//
// Tls session connection.
//
@@ -1270,11 +1270,11 @@ HttpConnectTcp4 (
TlsCloseTxRxEvent (HttpInstance);
return Status;
}
Status = TlsConnectSession (HttpInstance, HttpInstance->TimeoutEvent);
gBS->SetTimer (HttpInstance->TimeoutEvent, TimerCancel, 0);
if (EFI_ERROR (Status)) {
TlsCloseTxRxEvent (HttpInstance);
return Status;
@@ -1285,7 +1285,7 @@ HttpConnectTcp4 (
}
/**
Check existing TCP connection, if in error state, recover TCP6 connection. Then,
Check existing TCP connection, if in error state, recover TCP6 connection. Then,
connect one TLS session if required.
@param[in] HttpInstance The HTTP instance private data.
@@ -1315,7 +1315,7 @@ HttpConnectTcp6 (
NULL,
NULL
);
if (EFI_ERROR(Status)){
DEBUG ((EFI_D_ERROR, "Tcp6 GetModeData fail - %x\n", Status));
return Status;
@@ -1332,7 +1332,7 @@ HttpConnectTcp6 (
DEBUG ((EFI_D_ERROR, "Tcp6 Connection fail - %x\n", Status));
return Status;
}
//
// Tls session connection.
//
@@ -1362,11 +1362,11 @@ HttpConnectTcp6 (
TlsCloseTxRxEvent (HttpInstance);
return Status;
}
Status = TlsConnectSession (HttpInstance, HttpInstance->TimeoutEvent);
gBS->SetTimer (HttpInstance->TimeoutEvent, TimerCancel, 0);
if (EFI_ERROR (Status)) {
TlsCloseTxRxEvent (HttpInstance);
return Status;
@@ -1384,7 +1384,7 @@ HttpConnectTcp6 (
@param[in] Configure The Flag indicates whether need to initialize session.
@param[in] TlsConfigure The Flag indicates whether it's the new Tls session.
@retval EFI_SUCCESS The initialization of session is done.
@retval EFI_SUCCESS The initialization of session is done.
@retval Others Other error as indicated.
**/
@@ -1446,9 +1446,9 @@ HttpInitSession (
return Status;
}
}
return EFI_SUCCESS;
}
/**
@@ -1476,7 +1476,7 @@ HttpTransmitTcp (
EFI_TCP4_PROTOCOL *Tcp4;
EFI_TCP6_IO_TOKEN *Tx6Token;
EFI_TCP6_PROTOCOL *Tcp6;
UINT8 *TlsRecord;
UINT8 *TlsRecord;
UINT16 PayloadSize;
NET_FRAGMENT TempFragment;
NET_FRAGMENT Fragment;
@@ -1522,19 +1522,19 @@ HttpTransmitTcp (
RemainingLen = TxStringLen;
while (RemainingLen != 0) {
PayloadSize = (UINT16) MIN (TLS_PLAINTEXT_RECORD_MAX_PAYLOAD_LENGTH, RemainingLen);
((TLS_RECORD_HEADER *) TlsRecord)->ContentType = TlsContentTypeApplicationData;
((TLS_RECORD_HEADER *) TlsRecord)->Version.Major = HttpInstance->TlsConfigData.Version.Major;
((TLS_RECORD_HEADER *) TlsRecord)->Version.Minor = HttpInstance->TlsConfigData.Version.Minor;
((TLS_RECORD_HEADER *) TlsRecord)->Length = PayloadSize;
CopyMem (TlsRecord + TLS_RECORD_HEADER_LENGTH, TxString + (TxStringLen - RemainingLen), PayloadSize);
Status = TlsProcessMessage (
HttpInstance,
TlsRecord,
TLS_RECORD_HEADER_LENGTH + PayloadSize,
EfiTlsEncrypt,
HttpInstance,
TlsRecord,
TLS_RECORD_HEADER_LENGTH + PayloadSize,
EfiTlsEncrypt,
&TempFragment
);
if (EFI_ERROR (Status)) {
@@ -1542,7 +1542,7 @@ HttpTransmitTcp (
}
//
// Record the processed/encrypted Packet.
// Record the processed/encrypted Packet.
//
CopyMem (Fragment.Bulk + Fragment.Len, TempFragment.Bulk, TempFragment.Len);
Fragment.Len += TempFragment.Len;
@@ -1550,7 +1550,7 @@ HttpTransmitTcp (
FreePool (TempFragment.Bulk);
TempFragment.Len = 0;
TempFragment.Bulk = NULL;
RemainingLen -= (UINTN) PayloadSize;
ZeroMem (TlsRecord, TLS_RECORD_HEADER_LENGTH + TLS_PLAINTEXT_RECORD_MAX_PAYLOAD_LENGTH);
}
@@ -1558,7 +1558,7 @@ HttpTransmitTcp (
FreePool (TlsRecord);
TlsRecord = NULL;
}
if (!HttpInstance->LocalAddressIsIPv6) {
Tcp4 = HttpInstance->Tcp4;
Tx4Token = &Wrap->TcpWrap.Tx4Token;
@@ -1572,9 +1572,9 @@ HttpTransmitTcp (
Tx4Token->Packet.TxData->FragmentTable[0].FragmentLength = (UINT32) TxStringLen;
Tx4Token->Packet.TxData->FragmentTable[0].FragmentBuffer = (VOID *) TxString;
}
Tx4Token->CompletionToken.Status = EFI_NOT_READY;
Tx4Token->CompletionToken.Status = EFI_NOT_READY;
Wrap->TcpWrap.IsTxDone = FALSE;
Status = Tcp4->Transmit (Tcp4, Tx4Token);
if (EFI_ERROR (Status)) {
@@ -1585,7 +1585,7 @@ HttpTransmitTcp (
} else {
Tcp6 = HttpInstance->Tcp6;
Tx6Token = &Wrap->TcpWrap.Tx6Token;
if (HttpInstance->UseHttps) {
Tx6Token->Packet.TxData->DataLength = Fragment.Len;
Tx6Token->Packet.TxData->FragmentTable[0].FragmentLength = Fragment.Len;
@@ -1595,7 +1595,7 @@ HttpTransmitTcp (
Tx6Token->Packet.TxData->FragmentTable[0].FragmentLength = (UINT32) TxStringLen;
Tx6Token->Packet.TxData->FragmentTable[0].FragmentBuffer = (VOID *) TxString;
}
Tx6Token->CompletionToken.Status = EFI_NOT_READY;
Wrap->TcpWrap.IsTxDone = FALSE;
@@ -1605,17 +1605,17 @@ HttpTransmitTcp (
goto ON_ERROR;
}
}
return Status;
ON_ERROR:
if (HttpInstance->UseHttps) {
if (TlsRecord != NULL) {
FreePool (TlsRecord);
TlsRecord = NULL;
}
if (Fragment.Bulk != NULL) {
FreePool (Fragment.Bulk);
Fragment.Bulk = NULL;
@@ -1686,7 +1686,7 @@ HttpTcpNotReady (
if (!ValueInItem->TcpWrap.IsTxDone) {
return EFI_NOT_READY;
}
return EFI_SUCCESS;
}
@@ -1798,8 +1798,8 @@ HttpTcpReceive (
@param[in, out] SizeofHeaders The HTTP header length.
@param[in, out] BufferSize The size of buffer to cacahe the header message.
@param[in] Timeout The time to wait for receiving the header packet.
@retval EFI_SUCCESS The HTTP header is received.
@retval EFI_SUCCESS The HTTP header is received.
@retval Others Other errors as indicated.
**/
@@ -1832,7 +1832,7 @@ HttpTcpReceiveHeader (
Rx6Token = NULL;
Fragment.Len = 0;
Fragment.Bulk = NULL;
if (HttpInstance->LocalAddressIsIPv6) {
ASSERT (Tcp6 != NULL);
} else {
@@ -1855,7 +1855,7 @@ HttpTcpReceiveHeader (
return Status;
}
}
//
// Receive the HTTP headers only when EFI_HTTP_RESPONSE_DATA is not NULL.
//
@@ -1887,7 +1887,7 @@ HttpTcpReceiveHeader (
if (EFI_ERROR (Status)) {
return Status;
}
Fragment.Len = Rx4Token->Packet.RxData->FragmentTable[0].FragmentLength;
Fragment.Bulk = (UINT8 *) Rx4Token->Packet.RxData->FragmentTable[0].FragmentBuffer;
} else {
@@ -1895,7 +1895,7 @@ HttpTcpReceiveHeader (
FreePool (Fragment.Bulk);
Fragment.Bulk = NULL;
}
Status = HttpsReceive (HttpInstance, &Fragment, Timeout);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Tcp4 receive failed: %r\n", Status));
@@ -1931,7 +1931,7 @@ HttpTcpReceiveHeader (
//
*EndofHeader = AsciiStrStr (*HttpHeaders, HTTP_END_OF_HDR_STR);
};
//
// Free the buffer.
//
@@ -1944,7 +1944,7 @@ HttpTcpReceiveHeader (
if (Fragment.Bulk != NULL) {
FreePool (Fragment.Bulk);
Fragment.Bulk = NULL;
}
}
} else {
if (!HttpInstance->UseHttps) {
Rx6Token = &HttpInstance->Rx6Token;
@@ -1954,7 +1954,7 @@ HttpTcpReceiveHeader (
return Status;
}
}
//
// Receive the HTTP headers only when EFI_HTTP_RESPONSE_DATA is not NULL.
//
@@ -1986,7 +1986,7 @@ HttpTcpReceiveHeader (
if (EFI_ERROR (Status)) {
return Status;
}
Fragment.Len = Rx6Token->Packet.RxData->FragmentTable[0].FragmentLength;
Fragment.Bulk = (UINT8 *) Rx6Token->Packet.RxData->FragmentTable[0].FragmentBuffer;
} else {
@@ -1994,7 +1994,7 @@ HttpTcpReceiveHeader (
FreePool (Fragment.Bulk);
Fragment.Bulk = NULL;
}
Status = HttpsReceive (HttpInstance, &Fragment, Timeout);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Tcp6 receive failed: %r\n", Status));
@@ -2028,7 +2028,7 @@ HttpTcpReceiveHeader (
//
// Check whether we received end of HTTP headers.
//
*EndofHeader = AsciiStrStr (*HttpHeaders, HTTP_END_OF_HDR_STR);
*EndofHeader = AsciiStrStr (*HttpHeaders, HTTP_END_OF_HDR_STR);
};
//
@@ -2044,7 +2044,7 @@ HttpTcpReceiveHeader (
FreePool (Fragment.Bulk);
Fragment.Bulk = NULL;
}
}
}
//
// Skip the CRLF after the HTTP headers.
@@ -2062,7 +2062,7 @@ HttpTcpReceiveHeader (
@param[in] Wrap The HTTP token's wrap data.
@param[in] HttpMsg The HTTP message data.
@retval EFI_SUCCESS The HTTP body is received.
@retval EFI_SUCCESS The HTTP body is received.
@retval Others Other error as indicated.
**/
@@ -2078,19 +2078,19 @@ HttpTcpReceiveBody (
EFI_TCP6_IO_TOKEN *Rx6Token;
EFI_TCP4_PROTOCOL *Tcp4;
EFI_TCP4_IO_TOKEN *Rx4Token;
HttpInstance = Wrap->HttpInstance;
Tcp4 = HttpInstance->Tcp4;
Tcp6 = HttpInstance->Tcp6;
Rx4Token = NULL;
Rx6Token = NULL;
if (HttpInstance->LocalAddressIsIPv6) {
ASSERT (Tcp6 != NULL);
} else {
ASSERT (Tcp4 != NULL);
}
if (HttpInstance->LocalAddressIsIPv6) {
Rx6Token = &Wrap->TcpWrap.Rx6Token;
Rx6Token ->Packet.RxData->DataLength = (UINT32) MIN (MAX_UINT32, HttpMsg->BodyLength);
@@ -2108,7 +2108,7 @@ HttpTcpReceiveBody (
Rx4Token->Packet.RxData->DataLength = (UINT32) MIN (MAX_UINT32, HttpMsg->BodyLength);
Rx4Token->Packet.RxData->FragmentTable[0].FragmentLength = (UINT32) MIN (MAX_UINT32, HttpMsg->BodyLength);
Rx4Token->Packet.RxData->FragmentTable[0].FragmentBuffer = (VOID *) HttpMsg->Body;
Rx4Token->CompletionToken.Status = EFI_NOT_READY;
Status = Tcp4->Receive (Tcp4, Rx4Token);
if (EFI_ERROR (Status)) {
@@ -2125,13 +2125,13 @@ HttpTcpReceiveBody (
Clean up Tcp Tokens while the Tcp transmission error occurs.
@param[in] Wrap Pointer to HTTP token's wrap data.
**/
VOID
HttpTcpTokenCleanup (
IN HTTP_TOKEN_WRAP *Wrap
)
{
{
HTTP_PROTOCOL *HttpInstance;
EFI_TCP4_IO_TOKEN *Rx4Token;
EFI_TCP6_IO_TOKEN *Rx6Token;
@@ -2140,10 +2140,10 @@ HttpTcpTokenCleanup (
HttpInstance = Wrap->HttpInstance;
Rx4Token = NULL;
Rx6Token = NULL;
if (HttpInstance->LocalAddressIsIPv6) {
Rx6Token = &Wrap->TcpWrap.Rx6Token;
if (Rx6Token->CompletionToken.Event != NULL) {
gBS->CloseEvent (Rx6Token->CompletionToken.Event);
Rx6Token->CompletionToken.Event = NULL;
@@ -2152,25 +2152,25 @@ HttpTcpTokenCleanup (
FreePool (Wrap);
Rx6Token = &HttpInstance->Rx6Token;
if (Rx6Token->CompletionToken.Event != NULL) {
gBS->CloseEvent (Rx6Token->CompletionToken.Event);
Rx6Token->CompletionToken.Event = NULL;
}
if (Rx6Token->Packet.RxData->FragmentTable[0].FragmentBuffer != NULL) {
FreePool (Rx6Token->Packet.RxData->FragmentTable[0].FragmentBuffer);
Rx6Token->Packet.RxData->FragmentTable[0].FragmentBuffer = NULL;
}
} else {
Rx4Token = &Wrap->TcpWrap.Rx4Token;
if (Rx4Token->CompletionToken.Event != NULL) {
gBS->CloseEvent (Rx4Token->CompletionToken.Event);
Rx4Token->CompletionToken.Event = NULL;
}
FreePool (Wrap);
Rx4Token = &HttpInstance->Rx4Token;
@@ -2179,8 +2179,8 @@ HttpTcpTokenCleanup (
gBS->CloseEvent (Rx4Token->CompletionToken.Event);
Rx4Token->CompletionToken.Event = NULL;
}
if (Rx4Token->Packet.RxData->FragmentTable[0].FragmentBuffer != NULL) {
FreePool (Rx4Token->Packet.RxData->FragmentTable[0].FragmentBuffer);
Rx4Token->Packet.RxData->FragmentTable[0].FragmentBuffer = NULL;

View File

@@ -1,7 +1,7 @@
/** @file
The header files of miscellaneous routines for HttpDxe driver.
Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015 - 2018, 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
@@ -117,18 +117,18 @@ typedef struct _HTTP_PROTOCOL {
CHAR8 *RemoteHost;
UINT16 RemotePort;
EFI_IPv4_ADDRESS RemoteAddr;
EFI_HANDLE Tcp6ChildHandle;
EFI_TCP6_PROTOCOL *Tcp6;
EFI_TCP6_CONFIG_DATA Tcp6CfgData;
EFI_TCP6_OPTION Tcp6Option;
EFI_TCP6_CONNECTION_TOKEN Tcp6ConnToken;
BOOLEAN IsTcp6ConnDone;
EFI_TCP6_CLOSE_TOKEN Tcp6CloseToken;
BOOLEAN IsTcp6CloseDone;
EFI_IPv6_ADDRESS RemoteIpv6Addr;
//
// Rx4Token or Rx6Token used for receiving HTTP header.
//
@@ -149,7 +149,7 @@ typedef struct _HTTP_PROTOCOL {
// HTTP message-body parser.
//
VOID *MsgParser;
EFI_HTTP_VERSION HttpVersion;
UINT32 TimeOutMillisec;
BOOLEAN LocalAddressIsIPv6;
@@ -211,7 +211,7 @@ typedef struct {
)
/**
The common notify function used in HTTP driver.
The common notify function used in HTTP driver.
@param[in] Event The event signaled.
@param[in] Context The context.
@@ -288,14 +288,14 @@ HttpCreateTcpRxEventForHeader (
**/
EFI_STATUS
HttpCreateTcpRxEvent (
IN HTTP_TOKEN_WRAP *Wrap
IN HTTP_TOKEN_WRAP *Wrap
);
/**
Close Events for Tcp Receive Tokens for HTTP body and HTTP header.
@param[in] Wrap Pointer to HTTP token's wrap data.
**/
VOID
HttpCloseTcpRxEvent (
@@ -308,7 +308,7 @@ HttpCloseTcpRxEvent (
@param[in, out] HttpInstance Pointer to HTTP_PROTOCOL structure.
@param[in] IpVersion Indicate us TCP4 protocol or TCP6 protocol.
@retval EFI_SUCCESS HTTP_PROTOCOL structure is initialized successfully.
@retval EFI_SUCCESS HTTP_PROTOCOL structure is initialized successfully.
@retval Others Other error as indicated.
**/
@@ -390,7 +390,7 @@ HttpConfigureTcp6 (
);
/**
Check existing TCP connection, if in error state, recover TCP4 connection. Then,
Check existing TCP connection, if in error state, recover TCP4 connection. Then,
connect one TLS session if required.
@param[in] HttpInstance The HTTP instance private data.
@@ -406,7 +406,7 @@ HttpConnectTcp4 (
);
/**
Check existing TCP connection, if in error state, recover TCP6 connection. Then,
Check existing TCP connection, if in error state, recover TCP6 connection. Then,
connect one TLS session if required.
@param[in] HttpInstance The HTTP instance private data.
@@ -490,7 +490,7 @@ HttpTcpNotReady (
@param[in] Configure The Flag indicates whether need to initialize session.
@param[in] TlsConfigure The Flag indicates whether it's the new Tls session.
@retval EFI_SUCCESS The initialization of session is done.
@retval EFI_SUCCESS The initialization of session is done.
@retval Others Other error as indicated.
**/
@@ -550,7 +550,7 @@ HttpTcpReceive (
@param[in, out] BufferSize The size of buffer to cacahe the header message.
@param[in] Timeout The time to wait for receiving the header packet.
@retval EFI_SUCCESS The HTTP header is received.
@retval EFI_SUCCESS The HTTP header is received.
@retval Others Other errors as indicated.
**/
@@ -568,7 +568,7 @@ HttpTcpReceiveHeader (
@param[in] Wrap The HTTP token's wrap data.
@param[in] HttpMsg The HTTP message data.
@retval EFI_SUCCESS The HTTP body is received.
@retval EFI_SUCCESS The HTTP body is received.
@retval Others Other error as indicated.
**/
@@ -582,7 +582,7 @@ HttpTcpReceiveBody (
Clean up Tcp Tokens while the Tcp transmission error occurs.
@param[in] Wrap Pointer to HTTP token's wrap data.
**/
VOID
HttpTcpTokenCleanup (

View File

@@ -603,9 +603,9 @@ TlsConfigCipherList (
CipherListSize
);
ON_EXIT:
ON_EXIT:
FreePool (CipherList);
return Status;
}
@@ -1453,18 +1453,18 @@ TlsCloseSession (
Process one message according to the CryptMode.
@param[in] HttpInstance Pointer to HTTP_PROTOCOL structure.
@param[in] Message Pointer to the message buffer needed to processed.
@param[in] Message Pointer to the message buffer needed to processed.
If ProcessMode is EfiTlsEncrypt, the message contain the TLS
header and plain text TLS APP payload.
If ProcessMode is EfiTlsDecrypt, the message contain the TLS
If ProcessMode is EfiTlsDecrypt, the message contain the TLS
header and cipher text TLS APP payload.
@param[in] MessageSize Pointer to the message buffer size.
@param[in] ProcessMode Process mode.
@param[in, out] Fragment Only one Fragment returned after the Message is
processed successfully.
If ProcessMode is EfiTlsEncrypt, the fragment contain the TLS
If ProcessMode is EfiTlsEncrypt, the fragment contain the TLS
header and cipher text TLS APP payload.
If ProcessMode is EfiTlsDecrypt, the fragment contain the TLS
If ProcessMode is EfiTlsDecrypt, the fragment contain the TLS
header and plain text TLS APP payload.
@retval EFI_SUCCESS Message is processed successfully.

View File

@@ -217,18 +217,18 @@ TlsCloseSession (
Process one message according to the CryptMode.
@param[in] HttpInstance Pointer to HTTP_PROTOCOL structure.
@param[in] Message Pointer to the message buffer needed to processed.
@param[in] Message Pointer to the message buffer needed to processed.
If ProcessMode is EfiTlsEncrypt, the message contain the TLS
header and plain text TLS APP payload.
If ProcessMode is EfiTlsDecrypt, the message contain the TLS
If ProcessMode is EfiTlsDecrypt, the message contain the TLS
header and cipher text TLS APP payload.
@param[in] MessageSize Pointer to the message buffer size.
@param[in] ProcessMode Process mode.
@param[in, out] Fragment Only one Fragment returned after the Message is
processed successfully.
If ProcessMode is EfiTlsEncrypt, the fragment contain the TLS
If ProcessMode is EfiTlsEncrypt, the fragment contain the TLS
header and cipher text TLS APP payload.
If ProcessMode is EfiTlsDecrypt, the fragment contain the TLS
If ProcessMode is EfiTlsDecrypt, the fragment contain the TLS
header and plain text TLS APP payload.
@retval EFI_SUCCESS Message is processed successfully.