NetworkPkg: Print error message to screen if error occurs during HTTP boot.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
This commit is contained in:
Fu Siyuan
2017-11-13 15:20:37 +08:00
parent 5d8aa7eb6f
commit fca04738c9
3 changed files with 24 additions and 0 deletions

View File

@ -1093,6 +1093,7 @@ HttpBootCheckUriScheme (
// Return EFI_INVALID_PARAMETER if the URI is not HTTP or HTTPS.
//
if ((AsciiStrnCmp (Uri, "http://", 7) != 0) && (AsciiStrnCmp (Uri, "https://", 8) != 0)) {
AsciiPrint ("\n Error: Invalid URI address.\n");
DEBUG ((EFI_D_ERROR, "HttpBootCheckUriScheme: Invalid Uri.\n"));
return EFI_INVALID_PARAMETER;
}
@ -1101,6 +1102,7 @@ HttpBootCheckUriScheme (
// HTTP is disabled, return EFI_ACCESS_DENIED if the URI is HTTP.
//
if (!PcdGetBool (PcdAllowHttpConnections) && (AsciiStrnCmp (Uri, "http://", 7) == 0)) {
AsciiPrint ("\n Error: Access forbidden, only HTTPS connection is allowed.\n");
DEBUG ((EFI_D_ERROR, "HttpBootCheckUriScheme: HTTP is disabled.\n"));
return EFI_ACCESS_DENIED;
}