summaryrefslogtreecommitdiff
path: root/NetworkPkg/HttpBootDxe
diff options
context:
space:
mode:
Diffstat (limited to 'NetworkPkg/HttpBootDxe')
-rw-r--r--NetworkPkg/HttpBootDxe/HttpBootClient.c10
-rw-r--r--NetworkPkg/HttpBootDxe/HttpBootSupport.c18
-rw-r--r--NetworkPkg/HttpBootDxe/HttpBootSupport.h14
3 files changed, 26 insertions, 16 deletions
diff --git a/NetworkPkg/HttpBootDxe/HttpBootClient.c b/NetworkPkg/HttpBootDxe/HttpBootClient.c
index f0817e92e2..dd835c4f83 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootClient.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootClient.c
@@ -1,7 +1,7 @@
/** @file
Implementation of the boot file download function.
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
@@ -717,6 +717,7 @@ HttpBootGetBootFile (
)
{
EFI_STATUS Status;
+ EFI_HTTP_STATUS_CODE StatusCode;
CHAR8 *HostName;
EFI_HTTP_REQUEST_DATA *RequestData;
HTTP_IO_RESPONSE_DATA *ResponseData;
@@ -894,7 +895,12 @@ HttpBootGetBootFile (
TRUE,
ResponseData
);
- if (EFI_ERROR (Status)) {
+ if (EFI_ERROR (Status) || EFI_ERROR (ResponseData->Status)) {
+ if (EFI_ERROR (ResponseData->Status)) {
+ StatusCode = HttpIo->RspToken.Message->Data.Response->StatusCode;
+ HttpBootPrintErrorMessage (StatusCode);
+ Status = ResponseData->Status;
+ }
goto ERROR_5;
}
diff --git a/NetworkPkg/HttpBootDxe/HttpBootSupport.c b/NetworkPkg/HttpBootDxe/HttpBootSupport.c
index f9bbe4b1a0..db2af780a1 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootSupport.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootSupport.c
@@ -1,7 +1,7 @@
/** @file
Support functions implementation for UEFI HTTP boot driver.
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
@@ -930,7 +930,6 @@ HttpIoRecvResponse (
{
EFI_STATUS Status;
EFI_HTTP_PROTOCOL *Http;
- EFI_HTTP_STATUS_CODE StatusCode;
if (HttpIo == NULL || HttpIo->Http == NULL || ResponseData == NULL) {
return EFI_INVALID_PARAMETER;
@@ -971,17 +970,10 @@ HttpIoRecvResponse (
//
// Store the received data into the wrapper.
//
- Status = HttpIo->RspToken.Status;
- if (!EFI_ERROR (Status)) {
- ResponseData->HeaderCount = HttpIo->RspToken.Message->HeaderCount;
- ResponseData->Headers = HttpIo->RspToken.Message->Headers;
- ResponseData->BodyLength = HttpIo->RspToken.Message->BodyLength;
- }
-
- if (RecvMsgHeader) {
- StatusCode = HttpIo->RspToken.Message->Data.Response->StatusCode;
- HttpBootPrintErrorMessage (StatusCode);
- }
+ ResponseData->Status = HttpIo->RspToken.Status;
+ ResponseData->HeaderCount = HttpIo->RspToken.Message->HeaderCount;
+ ResponseData->Headers = HttpIo->RspToken.Message->Headers;
+ ResponseData->BodyLength = HttpIo->RspToken.Message->BodyLength;
return Status;
}
diff --git a/NetworkPkg/HttpBootDxe/HttpBootSupport.h b/NetworkPkg/HttpBootDxe/HttpBootSupport.h
index 2eba14e026..8e0fc37fdd 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootSupport.h
+++ b/NetworkPkg/HttpBootDxe/HttpBootSupport.h
@@ -1,7 +1,7 @@
/** @file
Support functions declaration for UEFI HTTP boot driver.
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
@@ -81,6 +81,17 @@ HttpBootShowIp6Addr (
IN EFI_IPv6_ADDRESS *Ip
);
+/**
+ This function is to display the HTTP error status.
+
+ @param[in] StatusCode The status code value in HTTP message.
+
+**/
+VOID
+HttpBootPrintErrorMessage (
+ EFI_HTTP_STATUS_CODE StatusCode
+ );
+
//
// A wrapper structure to hold the HTTP headers.
//
@@ -196,6 +207,7 @@ typedef struct {
EFI_HTTP_HEADER *Headers;
UINTN BodyLength;
CHAR8 *Body;
+ EFI_STATUS Status;
} HTTP_IO_RESPONSE_DATA;
/**