HTTP_PROTOCOL *HttpInstance;\r
BOOLEAN Configure;\r
BOOLEAN ReConfigure;\r
- CHAR8 *RequestStr;\r
+ CHAR8 *RequestMsg;\r
CHAR8 *Url;\r
UINTN UrlLen;\r
CHAR16 *HostNameStr;\r
HTTP_TOKEN_WRAP *Wrap;\r
CHAR8 *FileUrl;\r
+ UINTN RequestMsgSize;\r
\r
if ((This == NULL) || (Token == NULL)) {\r
return EFI_INVALID_PARAMETER;\r
goto Error1;\r
}\r
\r
- RequestStr = NULL;\r
+ RequestMsg = NULL;\r
HostName = NULL;\r
Status = HttpUrlGetHostName (Url, UrlParser, &HostName);\r
if (EFI_ERROR (Status)) {\r
}\r
}\r
\r
- Status = HttpGenRequestString (HttpMsg, FileUrl, &RequestStr);\r
+ Status = HttpGenRequestMessage (HttpMsg, FileUrl, &RequestMsg, &RequestMsgSize);\r
\r
if (EFI_ERROR (Status)) {\r
goto Error3;\r
Status = HttpTransmitTcp (\r
HttpInstance,\r
Wrap,\r
- (UINT8*) RequestStr,\r
- AsciiStrLen (RequestStr)\r
+ (UINT8*) RequestMsg,\r
+ RequestMsgSize\r
);\r
if (EFI_ERROR (Status)) {\r
goto Error5; \r
NetMapRemoveTail (&HttpInstance->TxTokens, NULL);\r
\r
Error4:\r
- if (RequestStr != NULL) {\r
- FreePool (RequestStr);\r
+ if (RequestMsg != NULL) {\r
+ FreePool (RequestMsg);\r
} \r
\r
Error3:\r
{\r
HTTP_TOKEN_WRAP *ValueInItem;\r
EFI_STATUS Status;\r
- CHAR8 *RequestStr;\r
+ CHAR8 *RequestMsg;\r
CHAR8 *Url;\r
+ UINTN RequestMsgSize;\r
\r
ValueInItem = (HTTP_TOKEN_WRAP *) Item->Value;\r
if (ValueInItem->TcpWrap.IsTxDone) {\r
//\r
// Create request message.\r
//\r
- Status = HttpGenRequestString (\r
+ Status = HttpGenRequestMessage (\r
ValueInItem->HttpToken->Message,\r
Url,\r
- &RequestStr\r
+ &RequestMsg,\r
+ &RequestMsgSize\r
);\r
FreePool (Url);\r
\r
Status = HttpTransmitTcp (\r
ValueInItem->HttpInstance,\r
ValueInItem,\r
- (UINT8*) RequestStr,\r
- AsciiStrLen (RequestStr)\r
+ (UINT8*) RequestMsg,\r
+ RequestMsgSize\r
);\r
- FreePool (RequestStr);\r
+ FreePool (RequestMsg);\r
return Status;\r
}\r
\r
StrLength = sizeof("\r\n") - 1;\r
*NewMessageSize += StrLength;\r
\r
- //\r
- // Final 0 for end flag\r
- //\r
- *NewMessageSize += 1; \r
-\r
*NewMessage = AllocateZeroPool (*NewMessageSize);\r
if (*NewMessage == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
CopyMem (NewMessagePtr, "\r\n", StrLength);\r
NewMessagePtr += StrLength;\r
\r
- *NewMessagePtr = 0;\r
-\r
- ASSERT (*NewMessageSize == (UINTN)NewMessagePtr - (UINTN)(*NewMessage) + 1);\r
+ ASSERT (*NewMessageSize == (UINTN)NewMessagePtr - (UINTN)(*NewMessage));\r
\r
//\r
// Free allocated buffer \r