- if (HttpIsMessageComplete (HttpInstance->MsgParser)) {\r
- //\r
- // Free the MsgParse since we already have a full HTTP message.\r
- //\r
- HttpFreeMsgParser (HttpInstance->MsgParser);\r
- HttpInstance->MsgParser = NULL;\r
+ FreePool (HttpHeaders);\r
+ HttpHeaders = NULL;\r
+\r
+\r
+ //\r
+ // Init message-body parser by header information.\r
+ //\r
+ Status = HttpInitMsgParser (\r
+ HttpInstance->Method,\r
+ HttpMsg->Data.Response->StatusCode,\r
+ HttpMsg->HeaderCount,\r
+ HttpMsg->Headers,\r
+ HttpBodyParserCallback,\r
+ (VOID *) ValueInItem,\r
+ &HttpInstance->MsgParser\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ goto Error2;\r
+ }\r
+\r
+ //\r
+ // Check whether we received a complete HTTP message.\r
+ //\r
+ if (HttpInstance->CacheBody != NULL) {\r
+ Status = HttpParseMessageBody (HttpInstance->MsgParser, HttpInstance->CacheLen, HttpInstance->CacheBody);\r
+ if (EFI_ERROR (Status)) {\r
+ goto Error2;\r
+ }\r
+\r
+ if (HttpIsMessageComplete (HttpInstance->MsgParser)) {\r
+ //\r
+ // Free the MsgParse since we already have a full HTTP message.\r
+ //\r
+ HttpFreeMsgParser (HttpInstance->MsgParser);\r
+ HttpInstance->MsgParser = NULL;\r
+ }\r