]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg: Allow user to create a HTTP corporate boot option in setup page.
authorFu Siyuan <siyuan.fu@intel.com>
Mon, 25 Apr 2016 07:29:26 +0000 (15:29 +0800)
committerFu Siyuan <siyuan.fu@intel.com>
Wed, 27 Apr 2016 02:19:12 +0000 (10:19 +0800)
This patch updates the HTTP Boot Configuration page to allow the user to create
a corporate mode HTTP boot option, by leaving the URI string empty.
The patch also fix a bug that the L"https://" should use StrnCmp() with Length 8.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
NetworkPkg/HttpBootDxe/HttpBootConfig.c
NetworkPkg/HttpBootDxe/HttpBootConfigNVDataStruc.h

index c47dddcee826d31dd79fa0f2453e609d5f35ebe9..00e4782f567416a5220a1b4d9f452f42984f6eab 100644 (file)
@@ -79,9 +79,9 @@ HttpBootAddBootOption (
   }\r
 \r
   //\r
-  // Only accept http and https URI.\r
+  // Only accept empty URI, or http and https URI.\r
   //\r
-  if ((StrnCmp (Uri, L"http://", 7) != 0) && (StrnCmp (Uri, L"https://", 7) != 0)) {\r
+  if ((StrLen (Uri) != 0) && (StrnCmp (Uri, L"http://", 7) != 0) && (StrnCmp (Uri, L"https://", 8) != 0)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
   \r
@@ -577,9 +577,10 @@ HttpBootFormCallback (
     HiiSetString (CallbackInfo->RegisteredHandle, Value->string, Uri, NULL);\r
 \r
     //\r
-    // We only accept http and https, pop up a message box for unsupported URI.\r
+    // The URI should be either an empty string (for corporate environment) ,or http(s) for home environment.\r
+    // Pop up a message box for other unsupported URI.\r
     //\r
-    if ((StrnCmp (Uri, L"http://", 7) != 0) && (StrnCmp (Uri, L"https://", 7) != 0)) {\r
+    if ((StrLen (Uri) != 0) && (StrnCmp (Uri, L"http://", 7) != 0) && (StrnCmp (Uri, L"https://", 8) != 0)) {\r
       CreatePopUp (\r
         EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
         &Key,\r
index 37ce440411baab167dc75aafb375c6203d8e2f96..682306ef1f620e4e1a75d266a3a789e94cf6584c 100644 (file)
@@ -23,7 +23,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 //\r
 // Macros used for an IPv4 or an IPv6 address.\r
 //\r
-#define URI_STR_MIN_SIZE             8\r
+#define URI_STR_MIN_SIZE             0\r
 #define URI_STR_MAX_SIZE             255\r
 \r
 #define DESCRIPTION_STR_MIN_SIZE     6\r