]> git.proxmox.com Git - mirror_edk2.git/commitdiff
NetworkPkg/HttpDxe: Fix the incorrect SizeofHeaders in HttpTcpReceiveHeader().
authorJiaxin Wu <jiaxin.wu@intel.com>
Wed, 22 Nov 2017 06:34:30 +0000 (14:34 +0800)
committerJiaxin Wu <jiaxin.wu@intel.com>
Fri, 24 Nov 2017 00:24:26 +0000 (08:24 +0800)
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>
NetworkPkg/HttpDxe/HttpProto.c

index 1aa1816c527ac454adcff1bd7ea4d4925d131546..925281a9c067fe6851c3b646773d55354b84cf05 100644 (file)
@@ -1877,9 +1877,6 @@ HttpTcpReceiveHeader (
       // Check whether we received end of HTTP headers.\r
       //\r
       *EndofHeader = AsciiStrStr (*HttpHeaders, HTTP_END_OF_HDR_STR);\r
-      if (*EndofHeader != NULL) {\r
-        *SizeofHeaders = *EndofHeader - *HttpHeaders;\r
-      }\r
     };\r
     \r
     //\r
@@ -1979,9 +1976,6 @@ HttpTcpReceiveHeader (
       // Check whether we received end of HTTP headers.\r
       //\r
       *EndofHeader = AsciiStrStr (*HttpHeaders, HTTP_END_OF_HDR_STR); \r
-      if (*EndofHeader != NULL) {\r
-        *SizeofHeaders = *EndofHeader - *HttpHeaders;\r
-      }\r
     };\r
 \r
     //\r
@@ -2002,7 +1996,9 @@ HttpTcpReceiveHeader (
   //\r
   // Skip the CRLF after the HTTP headers.\r
   //\r
-  *EndofHeader = *EndofHeader + AsciiStrLen (HTTP_END_OF_HDR_STR);  \r
+  *EndofHeader = *EndofHeader + AsciiStrLen (HTTP_END_OF_HDR_STR);\r
+\r
+  *SizeofHeaders = *EndofHeader - *HttpHeaders;\r
 \r
   return EFI_SUCCESS;\r
 }\r