]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/HttpBootDxe/HttpBootClient.c
NetworkPkg: Use Http11 definitions in HttpDxe and HttpBootDxe
[mirror_edk2.git] / NetworkPkg / HttpBootDxe / HttpBootClient.c
index f0817e92e21e38b3d7ef4ccf606947ce2efbf605..2ccac8c842073e16c2697ce6dcf3759370e8e554 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
   Implementation of the boot file download function.\r
 \r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 This program and the accompanying materials are licensed and made available under \r
 the terms and conditions of the BSD License that accompanies this distribution.  \r
 The full text of the license may be found at\r
@@ -717,6 +718,7 @@ HttpBootGetBootFile (
   )\r
 {\r
   EFI_STATUS                 Status;\r
+  EFI_HTTP_STATUS_CODE       StatusCode;\r
   CHAR8                      *HostName;\r
   EFI_HTTP_REQUEST_DATA      *RequestData;\r
   HTTP_IO_RESPONSE_DATA      *ResponseData;\r
@@ -806,7 +808,7 @@ HttpBootGetBootFile (
   }\r
   Status = HttpBootSetHeader (\r
              HttpIoHeader,\r
-             HTTP_FIELD_NAME_HOST,\r
+             HTTP_HEADER_HOST,\r
              HostName\r
              );\r
   FreePool (HostName);\r
@@ -819,7 +821,7 @@ HttpBootGetBootFile (
   //\r
   Status = HttpBootSetHeader (\r
              HttpIoHeader,\r
-             HTTP_FIELD_NAME_ACCEPT,\r
+             HTTP_HEADER_ACCEPT,\r
              "*/*"\r
              );\r
   if (EFI_ERROR (Status)) {\r
@@ -831,7 +833,7 @@ HttpBootGetBootFile (
   //\r
   Status = HttpBootSetHeader (\r
              HttpIoHeader,\r
-             HTTP_FIELD_NAME_USER_AGENT,\r
+             HTTP_HEADER_USER_AGENT,\r
              HTTP_USER_AGENT_EFI_HTTP_BOOT\r
              );\r
   if (EFI_ERROR (Status)) {\r
@@ -894,7 +896,12 @@ HttpBootGetBootFile (
              TRUE,\r
              ResponseData\r
              );\r
-  if (EFI_ERROR (Status)) {\r
+  if (EFI_ERROR (Status) || EFI_ERROR (ResponseData->Status)) {\r
+    if (EFI_ERROR (ResponseData->Status)) {\r
+      StatusCode = HttpIo->RspToken.Message->Data.Response->StatusCode;\r
+      HttpBootPrintErrorMessage (StatusCode);\r
+      Status = ResponseData->Status;\r
+    }\r
     goto ERROR_5;\r
   }\r
 \r