NetworkPkg:HttpDxe:Consume DxeHttpLib API changes
HttpGenRequestString is updated to HttpGenRequestMessage, with an additional argument. This patch updates the caller of the DxeHttpLib API. Also, we will avoid adding any '\0' to the string, which was added to make AsciiStrLen to work on the string. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Nagaraj Hegde <nagaraj-p.hegde@hpe.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
This commit is contained in:
@@ -240,12 +240,13 @@ EfiHttpRequest (
|
||||
HTTP_PROTOCOL *HttpInstance;
|
||||
BOOLEAN Configure;
|
||||
BOOLEAN ReConfigure;
|
||||
CHAR8 *RequestStr;
|
||||
CHAR8 *RequestMsg;
|
||||
CHAR8 *Url;
|
||||
UINTN UrlLen;
|
||||
CHAR16 *HostNameStr;
|
||||
HTTP_TOKEN_WRAP *Wrap;
|
||||
CHAR8 *FileUrl;
|
||||
UINTN RequestMsgSize;
|
||||
|
||||
if ((This == NULL) || (Token == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
@@ -314,7 +315,7 @@ EfiHttpRequest (
|
||||
goto Error1;
|
||||
}
|
||||
|
||||
RequestStr = NULL;
|
||||
RequestMsg = NULL;
|
||||
HostName = NULL;
|
||||
Status = HttpUrlGetHostName (Url, UrlParser, &HostName);
|
||||
if (EFI_ERROR (Status)) {
|
||||
@@ -498,7 +499,7 @@ EfiHttpRequest (
|
||||
}
|
||||
}
|
||||
|
||||
Status = HttpGenRequestString (HttpMsg, FileUrl, &RequestStr);
|
||||
Status = HttpGenRequestMessage (HttpMsg, FileUrl, &RequestMsg, &RequestMsgSize);
|
||||
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Error3;
|
||||
@@ -515,8 +516,8 @@ EfiHttpRequest (
|
||||
Status = HttpTransmitTcp (
|
||||
HttpInstance,
|
||||
Wrap,
|
||||
(UINT8*) RequestStr,
|
||||
AsciiStrLen (RequestStr)
|
||||
(UINT8*) RequestMsg,
|
||||
RequestMsgSize
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Error5;
|
||||
@@ -534,8 +535,8 @@ Error5:
|
||||
NetMapRemoveTail (&HttpInstance->TxTokens, NULL);
|
||||
|
||||
Error4:
|
||||
if (RequestStr != NULL) {
|
||||
FreePool (RequestStr);
|
||||
if (RequestMsg != NULL) {
|
||||
FreePool (RequestMsg);
|
||||
}
|
||||
|
||||
Error3:
|
||||
|
Reference in New Issue
Block a user