NetworkPkg/HttpDxe: Fix the bug when parsing HTTP(S) message body.

*v2: Resolve the conflict commit.

*v3: Fixed the failure if BodyLength in HTTP token is less than the received
size of HTTPS message.

HttpBodyParserCallback function is to parse the HTTP(S) message body so as to
confirm whether there is the next message header. But it doesn't record the
parsing message data/length correctly.

This patch is refine the parsing logic so as to fix the potential failure.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Gary Lin <glin@suse.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Tested-by: Gary Lin <glin@suse.com>
This commit is contained in:
Jiaxin Wu
2018-07-02 09:48:12 +08:00
parent c6a14de3ef
commit 895b87e380
3 changed files with 78 additions and 54 deletions

View File

@@ -197,6 +197,16 @@ HttpTcpReceiveNotifyDpc (
Length = (UINTN) Wrap->TcpWrap.Rx4Data.FragmentTable[0].FragmentLength;
}
//
// Record the CallbackData data.
//
HttpInstance->CallbackData.Wrap = (VOID *) Wrap;
HttpInstance->CallbackData.ParseData = Wrap->HttpToken->Message->Body;
HttpInstance->CallbackData.ParseDataLength = Length;
//
// Parse Body with CallbackData data.
//
Status = HttpParseMessageBody (
HttpInstance->MsgParser,
Length,