summaryrefslogtreecommitdiffstats
path: root/NetworkPkg
diff options
context:
space:
mode:
authorJiaxin Wu <jiaxin.wu@intel.com>2017-11-22 14:34:30 +0800
committerJiaxin Wu <jiaxin.wu@intel.com>2017-11-24 08:24:26 +0800
commitb16abfcc3497a51e32214bb50f4be8c3a36fa5f0 (patch)
treee4802163a8fd2e1d8595e4a223867d0a0e4e3062 /NetworkPkg
parent3d544c564bd6bd4a9f5239ed6300c28b789d2a0d (diff)
downloadedk2-b16abfcc3497a51e32214bb50f4be8c3a36fa5f0.tar.gz
edk2-b16abfcc3497a51e32214bb50f4be8c3a36fa5f0.tar.bz2
edk2-b16abfcc3497a51e32214bb50f4be8c3a36fa5f0.zip
NetworkPkg/HttpDxe: Fix the incorrect SizeofHeaders in HttpTcpReceiveHeader().
Commit 19bd133562df951ae7ff7e1fff99b11a25b4cb6d is to fix the incorrect SizeofHeaders returned from HttpTcpReceiveHeader(). But it missed the "\r\n\r\n" calculation, which will cause the later HttpHeaders parsing failure. This patch is fix the above issue. Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.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>
Diffstat (limited to 'NetworkPkg')
-rw-r--r--NetworkPkg/HttpDxe/HttpProto.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c
index 1aa1816c52..925281a9c0 100644
--- a/NetworkPkg/HttpDxe/HttpProto.c
+++ b/NetworkPkg/HttpDxe/HttpProto.c
@@ -1877,9 +1877,6 @@ HttpTcpReceiveHeader (
// Check whether we received end of HTTP headers.
//
*EndofHeader = AsciiStrStr (*HttpHeaders, HTTP_END_OF_HDR_STR);
- if (*EndofHeader != NULL) {
- *SizeofHeaders = *EndofHeader - *HttpHeaders;
- }
};
//
@@ -1979,9 +1976,6 @@ HttpTcpReceiveHeader (
// Check whether we received end of HTTP headers.
//
*EndofHeader = AsciiStrStr (*HttpHeaders, HTTP_END_OF_HDR_STR);
- if (*EndofHeader != NULL) {
- *SizeofHeaders = *EndofHeader - *HttpHeaders;
- }
};
//
@@ -2002,7 +1996,9 @@ HttpTcpReceiveHeader (
//
// Skip the CRLF after the HTTP headers.
//
- *EndofHeader = *EndofHeader + AsciiStrLen (HTTP_END_OF_HDR_STR);
+ *EndofHeader = *EndofHeader + AsciiStrLen (HTTP_END_OF_HDR_STR);
+
+ *SizeofHeaders = *EndofHeader - *HttpHeaders;
return EFI_SUCCESS;
}