NetworkPkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr
It is the follow up of 3ab41b7a32
to replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr with
UnicodeStrToAsciiStrS/AsciiStrToUnicodeStrS.
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
This commit is contained in:
@@ -236,6 +236,7 @@ EfiHttpRequest (
|
||||
VOID *UrlParser;
|
||||
EFI_STATUS Status;
|
||||
CHAR8 *HostName;
|
||||
UINTN HostNameSize;
|
||||
UINT16 RemotePort;
|
||||
HTTP_PROTOCOL *HttpInstance;
|
||||
BOOLEAN Configure;
|
||||
@@ -343,7 +344,7 @@ EfiHttpRequest (
|
||||
}
|
||||
|
||||
|
||||
UnicodeStrToAsciiStr (Request->Url, Url);
|
||||
UnicodeStrToAsciiStrS (Request->Url, Url, UrlLen);
|
||||
UrlParser = NULL;
|
||||
Status = HttpParseUrl (Url, (UINT32) AsciiStrLen (Url), FALSE, &UrlParser);
|
||||
if (EFI_ERROR (Status)) {
|
||||
@@ -443,13 +444,14 @@ EfiHttpRequest (
|
||||
}
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
HostNameStr = AllocateZeroPool ((AsciiStrLen (HostName) + 1) * sizeof (CHAR16));
|
||||
HostNameSize = AsciiStrSize (HostName);
|
||||
HostNameStr = AllocateZeroPool (HostNameSize * sizeof (CHAR16));
|
||||
if (HostNameStr == NULL) {
|
||||
Status = EFI_OUT_OF_RESOURCES;
|
||||
goto Error1;
|
||||
}
|
||||
|
||||
AsciiStrToUnicodeStr (HostName, HostNameStr);
|
||||
AsciiStrToUnicodeStrS (HostName, HostNameStr, HostNameSize);
|
||||
if (!HttpInstance->LocalAddressIsIPv6) {
|
||||
Status = HttpDns4 (HttpInstance, HostNameStr, &HttpInstance->RemoteAddr);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user