summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/DxeHttpLib
diff options
context:
space:
mode:
authorZhang Lubo <lubo.zhang@intel.com>2015-12-17 15:15:13 +0000
committervanjeff <vanjeff@Edk2>2015-12-17 15:15:13 +0000
commit99224547e3b98042aea13c48e67ebb0daf8e9e20 (patch)
tree95dd1b7e9877e838050fcd57a2c1f5597920e994 /MdeModulePkg/Library/DxeHttpLib
parent4b2bb7094053f8e7624a435b57f3ab547c5de043 (diff)
downloadedk2-platforms-99224547e3b98042aea13c48e67ebb0daf8e9e20.tar.xz
MdeModulePkg:Fix a bug HttpLib can't parse last chunked data well
When HttpLib parsing the last chunked data down, the Http NextMsg pointer in the HttpBodyParserCallback function should point to the character after '/n' flag. (Sync patch r19310 from main trunk.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@19324 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library/DxeHttpLib')
-rw-r--r--MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c39
1 files changed, 24 insertions, 15 deletions
diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
index 500b3c72b3..6b830fdd9b 100644
--- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
+++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c
@@ -1161,21 +1161,7 @@ HttpParseMessageBody (
switch (Parser->State) {
case BodyParserStateMax:
return EFI_ABORTED;
-
- case BodyParserComplete:
- if (Parser->Callback != NULL) {
- Status = Parser->Callback (
- BodyParseEventOnComplete,
- Char,
- 0,
- Parser->Context
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
- }
- return EFI_SUCCESS;
-
+
case BodyParserBodyIdentity:
//
// Identity transfer-coding, just notify user to save the body data.
@@ -1195,6 +1181,17 @@ HttpParseMessageBody (
Parser->ParsedBodyLength += MIN (BodyLength, Parser->ContentLength - Parser->ParsedBodyLength);
if (Parser->ParsedBodyLength == Parser->ContentLength) {
Parser->State = BodyParserComplete;
+ if (Parser->Callback != NULL) {
+ Status = Parser->Callback (
+ BodyParseEventOnComplete,
+ Char,
+ 0,
+ Parser->Context
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+ }
}
break;
@@ -1272,6 +1269,18 @@ HttpParseMessageBody (
case BodyParserLastCRLFEnd:
if (*Char == '\n') {
Parser->State = BodyParserComplete;
+ Char++;
+ if (Parser->Callback != NULL) {
+ Status = Parser->Callback (
+ BodyParseEventOnComplete,
+ Char,
+ 0,
+ Parser->Context
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+ }
break;
} else {
Parser->State = BodyParserStateMax;