Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>\r
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>\r
\r
- This program and the accompanying materials\r
- are licensed and made available under the terms and conditions of the BSD License\r
- which accompanies this distribution. The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.php.\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+ SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
goto Error1;\r
}\r
\r
- HostName = NULL;\r
- Status = HttpUrlGetHostName (Url, UrlParser, &HostName);\r
+ Status = HttpUrlGetHostName (Url, UrlParser, &HostName);\r
if (EFI_ERROR (Status)) {\r
- goto Error1;\r
+ goto Error1;\r
+ }\r
+\r
+ if (HttpInstance->LocalAddressIsIPv6) {\r
+ HostNameSize = AsciiStrSize (HostName);\r
+\r
+ if (HostNameSize > 2 && HostName[0] == '[' && HostName[HostNameSize - 2] == ']') {\r
+ //\r
+ // HostName format is expressed as IPv6, so, remove '[' and ']'.\r
+ //\r
+ HostNameSize -= 2;\r
+ CopyMem (HostName, HostName + 1, HostNameSize - 1);\r
+ HostName[HostNameSize - 1] = '\0';\r
+ }\r
}\r
\r
Status = HttpUrlGetPort (Url, UrlParser, &RemotePort);\r
//\r
// Process the received the body packet.\r
//\r
- HttpMsg->BodyLength = MIN (Fragment.Len, (UINT32) HttpMsg->BodyLength);\r
+ HttpMsg->BodyLength = MIN ((UINTN) Fragment.Len, HttpMsg->BodyLength);\r
\r
CopyMem (HttpMsg->Body, Fragment.Bulk, HttpMsg->BodyLength);\r
\r