NetworkPkg: Fix incorrect SizeofHeaders returned from HttpTcpReceiveHeader().

This patch is to fix a bug that the HttpTcpReceiveHeader() may return incorrect
SizeofHeaders, which will include some already received message-body.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
This commit is contained in:
Fu Siyuan 2017-11-15 10:42:17 +08:00
parent fca04738c9
commit 19bd133562
1 changed files with 7 additions and 1 deletions

View File

@ -1877,6 +1877,9 @@ HttpTcpReceiveHeader (
// Check whether we received end of HTTP headers.
//
*EndofHeader = AsciiStrStr (*HttpHeaders, HTTP_END_OF_HDR_STR);
if (*EndofHeader != NULL) {
*SizeofHeaders = *EndofHeader - *HttpHeaders;
}
};
//
@ -1976,6 +1979,9 @@ HttpTcpReceiveHeader (
// Check whether we received end of HTTP headers.
//
*EndofHeader = AsciiStrStr (*HttpHeaders, HTTP_END_OF_HDR_STR);
if (*EndofHeader != NULL) {
*SizeofHeaders = *EndofHeader - *HttpHeaders;
}
};
//