- //\r
- // Append the response string.\r
- //\r
- BufferSize = SizeofHeaders + RxToken->Packet.RxData->FragmentTable[0].FragmentLength;\r
- Buffer = AllocateZeroPool (BufferSize);\r
- if (Buffer == NULL) {\r
- Status = EFI_OUT_OF_RESOURCES;\r
- goto Error;\r
- }\r
-\r
- if (HttpHeaders != NULL) {\r
- CopyMem (Buffer, HttpHeaders, SizeofHeaders);\r
- FreePool (HttpHeaders);\r
- }\r
-\r
- CopyMem (\r
- Buffer + SizeofHeaders,\r
- RxToken->Packet.RxData->FragmentTable[0].FragmentBuffer,\r
- RxToken->Packet.RxData->FragmentTable[0].FragmentLength\r
- );\r
- HttpHeaders = Buffer;\r
- SizeofHeaders = BufferSize;\r
-\r
- //\r
- // Check whether we received end of HTTP headers.\r
- //\r
- EndofHeader = AsciiStrStr (HttpHeaders, HTTP_END_OF_HDR_STR); \r
- };\r
+ Status = HttpTcpReceiveHeader (HttpInstance, &SizeofHeaders, &BufferSize);\r
+ if (EFI_ERROR (Status)) {\r
+ goto Error;\r
+ }\r