NetworkPkg/HttpDxe: Fix the incorrect SizeofHeaders in HttpTcpReceiveHeader().

Commit 19bd133562 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>
This commit is contained in:
Jiaxin Wu 2017-11-22 14:34:30 +08:00
parent 3d544c564b
commit b16abfcc34
1 changed files with 3 additions and 7 deletions

View File

@ -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;
}