/** @file\r
Implementation of EFI_HTTP_PROTOCOL protocol interfaces.\r
\r
- Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
- (C) Copyright 2015 Hewlett Packard Enterprise Development LP<BR>\r
+ Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>\r
\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
goto Error3;\r
}\r
}\r
- RequestStr = HttpGenRequestString (HttpInstance, HttpMsg, FileUrl);\r
- if (RequestStr == NULL) {\r
- Status = EFI_OUT_OF_RESOURCES;\r
+\r
+ Status = HttpGenRequestString (HttpMsg, FileUrl, &RequestStr);\r
+\r
+ if (EFI_ERROR (Status)) {\r
goto Error3;\r
}\r
\r
HttpHeaders = NULL;\r
\r
HttpMsg->Data.Response->StatusCode = HttpMappingToStatusCode (StatusCode);\r
-\r
+ HttpInstance->StatusCode = StatusCode;\r
//\r
// Init message-body parser by header information. \r
//\r
if (Item != NULL) {\r
NetMapRemoveItem (&Wrap->HttpInstance->RxTokens, Item, NULL);\r
}\r
- Token->Status = Status;\r
+\r
+ if (HttpInstance->StatusCode >= HTTP_ERROR_OR_NOT_SUPPORT_STATUS_CODE) {\r
+ Token->Status = EFI_HTTP_ERROR;\r
+ } else {\r
+ Token->Status = Status;\r
+ }\r
+\r
gBS->SignalEvent (Token->Event);\r
HttpCloseTcpRxEvent (Wrap);\r
FreePool (Wrap);\r
HttpInstance->CacheBody = NULL;\r
}\r
\r
- Token->Status = Status;\r
+ if (HttpInstance->StatusCode >= HTTP_ERROR_OR_NOT_SUPPORT_STATUS_CODE) {\r
+ Token->Status = EFI_HTTP_ERROR;\r
+ } else {\r
+ Token->Status = Status;\r
+ }\r
+\r
gBS->SignalEvent (Token->Event);\r
\r
return Status; \r