/** @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
)\r
{\r
EFI_STATUS Status;\r
+ EFI_HTTP_STATUS_CODE StatusCode;\r
CHAR8 *HostName;\r
EFI_HTTP_REQUEST_DATA *RequestData;\r
- HTTP_IO_RESOPNSE_DATA *ResponseData;\r
- HTTP_IO_RESOPNSE_DATA ResponseBody;\r
+ HTTP_IO_RESPONSE_DATA *ResponseData;\r
+ HTTP_IO_RESPONSE_DATA ResponseBody;\r
HTTP_IO *HttpIo;\r
HTTP_IO_HEADER *HttpIoHeader;\r
VOID *Parser;\r
}\r
Status = HttpBootSetHeader (\r
HttpIoHeader,\r
- HTTP_FIELD_NAME_HOST,\r
+ HTTP_HEADER_HOST,\r
HostName\r
);\r
FreePool (HostName);\r
//\r
Status = HttpBootSetHeader (\r
HttpIoHeader,\r
- HTTP_FIELD_NAME_ACCEPT,\r
+ HTTP_HEADER_ACCEPT,\r
"*/*"\r
);\r
if (EFI_ERROR (Status)) {\r
//\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
//\r
// 3.1 First step, use zero BodyLength to only receive the response headers.\r
//\r
- ResponseData = AllocateZeroPool (sizeof(HTTP_IO_RESOPNSE_DATA));\r
+ ResponseData = AllocateZeroPool (sizeof(HTTP_IO_RESPONSE_DATA));\r
if (ResponseData == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
goto ERROR_4;\r
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
// 3.4.2, start the message-body download, the identity and chunked transfer-coding\r
// is handled in different path here.\r
//\r
- ZeroMem (&ResponseBody, sizeof (HTTP_IO_RESOPNSE_DATA));\r
+ ZeroMem (&ResponseBody, sizeof (HTTP_IO_RESPONSE_DATA));\r
if (IdentityMode) {\r
//\r
// In identity transfer-coding there is no need to parse the message body,\r