/** @file\r
Implementation of the boot file download function.\r
\r
-Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2018, 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
}\r
\r
//\r
- // Extract the HTTP server Ip frome URL. This is used to Check route table \r
+ // Extract the HTTP server Ip from URL. This is used to Check route table \r
// whether can send message to HTTP Server Ip through the GateWay.\r
//\r
Status = HttpUrlGetIp6 (\r
HTTP_BOOT_ENTITY_DATA *EntityData;\r
UINTN CopyedSize;\r
\r
- if (Uri == NULL || BufferSize == 0 || Buffer == NULL || ImageType == NULL) {\r
+ if (Uri == NULL || BufferSize == NULL || Buffer == NULL || ImageType == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
//\r
if ((Cache->RequestData != NULL) &&\r
(Cache->RequestData->Url != NULL) &&\r
- (StrCmp (Uri, Cache->RequestData->Url) == 0)) \r
- {\r
+ (StrCmp (Uri, Cache->RequestData->Url) == 0)) {\r
//\r
// Hit in cache, record image type.\r
//\r
return EFI_OUT_OF_RESOURCES;\r
}\r
AsciiStrToUnicodeStrS (Private->BootFileUri, Url, UrlSize);\r
- if (!HeaderOnly) {\r
+ if (!HeaderOnly && Buffer != NULL) {\r
Status = HttpBootGetFileFromCache (Private, Url, BufferSize, Buffer, ImageType);\r
if (Status != EFI_NOT_FOUND) {\r
FreePool (Url);\r
Context.Cache = Cache;\r
Context.Private = Private;\r
Status = HttpInitMsgParser (\r
- HeaderOnly? HttpMethodHead : HttpMethodGet,\r
+ HeaderOnly ? HttpMethodHead : HttpMethodGet,\r
ResponseData->Response.StatusCode,\r
ResponseData->HeaderCount,\r
ResponseData->Headers,\r