From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5A3092219BC89 for ; Wed, 20 Dec 2017 22:46:04 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Dec 2017 22:50:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,434,1508828400"; d="scan'208";a="4074953" Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.141]) by fmsmga007.fm.intel.com with ESMTP; 20 Dec 2017 22:50:51 -0800 From: Jiaxin Wu To: edk2-devel@lists.01.org Cc: Wang Fan , Ye Ting , Fu Siyuan , Wu Jiaxin Date: Thu, 21 Dec 2017 14:50:47 +0800 Message-Id: <1513839047-15032-3-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1513839047-15032-1-git-send-email-jiaxin.wu@intel.com> References: <1513839047-15032-1-git-send-email-jiaxin.wu@intel.com> Subject: [Patch 2/2] NetworkPkg/HttpBootDxe: Break the HttpBoot Callback function when meet redirect status. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 06:46:04 -0000 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 Cc: Ye Ting Cc: Fu Siyuan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin --- 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