[edk2] [Patch 2/2] NetworkPkg/HttpBootDxe: Break the HttpBoot Callback function when meet redirect status.

Jiaxin Wu posted 2 patches 7 years, 4 months ago
[edk2] [Patch 2/2] NetworkPkg/HttpBootDxe: Break the HttpBoot Callback function when meet redirect status.
Posted by Jiaxin Wu 7 years, 4 months ago
In HttpBootCallback(), when data type is HttpBootHttpResponse, function may meet
the resource redirect error. In current implementation, function will still go
ahead to find header for HTTP_HEADER_CONTENT_LENGTH, this is not expected. Function
should break in redirect status error handling.

Cc: Wang Fan <fan.wang@intel.com>
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>
---
 NetworkPkg/HttpBootDxe/HttpBootImpl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/NetworkPkg/HttpBootDxe/HttpBootImpl.c b/NetworkPkg/HttpBootDxe/HttpBootImpl.c
index d4b46a6..16c1207 100644
--- a/NetworkPkg/HttpBootDxe/HttpBootImpl.c
+++ b/NetworkPkg/HttpBootDxe/HttpBootImpl.c
@@ -709,10 +709,11 @@ HttpBootCallback (
                  HTTP_HEADER_LOCATION
                  );
           if (HttpHeader != NULL) {
             Print (L"\n  HTTP ERROR: Resource Redirected.\n  New Location: %a\n", HttpHeader->FieldValue);
           }
+          break; 
         }
       }
       
       HttpHeader = HttpFindHeader (
                      HttpMessage->HeaderCount,
-- 
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel