From nobody Sat May 10 23:31:09 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1514252044958548.8425209481983; Mon, 25 Dec 2017 17:34:04 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2EEF5222F4E04; Mon, 25 Dec 2017 17:29:07 -0800 (PST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 68817208F7A3C for ; Mon, 25 Dec 2017 17:29:05 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Dec 2017 17:33:59 -0800 Received: from jiaxinwu-mobl2.ccr.corp.intel.com ([10.239.196.165]) by orsmga002.jf.intel.com with ESMTP; 25 Dec 2017 17:33:58 -0800 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=jiaxin.wu@intel.com; receiver=edk2-devel@lists.01.org X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,457,1508828400"; d="scan'208";a="21327540" From: Jiaxin Wu To: edk2-devel@lists.01.org Date: Tue, 26 Dec 2017 09:33:48 +0800 Message-Id: <1514252029-12720-5-git-send-email-jiaxin.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1514252029-12720-1-git-send-email-jiaxin.wu@intel.com> References: <1514252029-12720-1-git-send-email-jiaxin.wu@intel.com> Subject: [edk2] [Patch 4/5] MdeModulePkg/DxeHttpLib: Correct some return 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: , Cc: Ye Ting , Wang Fan , Fu Siyuan , Wu Jiaxin MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Ye Ting Cc: Fu Siyuan Cc: Wang Fan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin --- MdeModulePkg/Include/Library/HttpLib.h | 5 +++-- MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/MdeModulePkg/Include/Library/HttpLib.h b/MdeModulePkg/Include/= Library/HttpLib.h index 88b56ae..285a831 100644 --- a/MdeModulePkg/Include/Library/HttpLib.h +++ b/MdeModulePkg/Include/Library/HttpLib.h @@ -284,12 +284,13 @@ HttpInitMsgParser ( @param[in] BodyLength Length in bytes of the Body. @param[in] Body Pointer to the buffer of the mes= sage-body to be parsed. =20 @retval EFI_SUCCESS Successfully parse the message-body. @retval EFI_INVALID_PARAMETER MsgParser is NULL or Body is NULL or = BodyLength is 0. - @retval Others Operation aborted. - + @retval EFI_ABORTED Operation aborted. + @retval Other Error happened while parsing message = body. + =20 **/ EFI_STATUS EFIAPI HttpParseMessageBody ( IN OUT VOID *MsgParser, diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c b/MdeModulePkg/Li= brary/DxeHttpLib/DxeHttpLib.c index 38ded5d..327ca9e 100644 --- a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c @@ -152,11 +152,11 @@ NetHttpParseAuthorityChar ( @param[in] Url The pointer to a HTTP URL string. @param[in] FoundAt TRUE if there is an at sign ('@') in the= authority component. @param[in, out] UrlParser Pointer to the buffer of the parse resul= t. =20 @retval EFI_SUCCESS Successfully parse the authority. - @retval Other Error happened. + @retval EFI_INVALID_PARAMETER The Url is invalid to parse the authorit= y component. =20 **/ EFI_STATUS NetHttpParseAuthority ( IN CHAR8 *Url, @@ -569,11 +569,11 @@ HttpUrlGetIp4 ( } =20 Parser =3D (HTTP_URL_PARSER*) UrlParser; =20 if ((Parser->FieldBitMap & BIT (HTTP_URI_FIELD_HOST)) =3D=3D 0) { - return EFI_INVALID_PARAMETER; + return EFI_NOT_FOUND; } =20 Ip4String =3D AllocatePool (Parser->FieldData[HTTP_URI_FIELD_HOST].Lengt= h + 1); if (Ip4String =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; @@ -632,11 +632,11 @@ HttpUrlGetIp6 ( } =20 Parser =3D (HTTP_URL_PARSER*) UrlParser; =20 if ((Parser->FieldBitMap & BIT (HTTP_URI_FIELD_HOST)) =3D=3D 0) { - return EFI_INVALID_PARAMETER; + return EFI_NOT_FOUND; } =20 // // IP-literal =3D "[" ( IPv6address / IPvFuture ) "]" // @@ -711,11 +711,11 @@ HttpUrlGetPort ( Index =3D 0; =20 Parser =3D (HTTP_URL_PARSER*) UrlParser; =20 if ((Parser->FieldBitMap & BIT (HTTP_URI_FIELD_PORT)) =3D=3D 0) { - return EFI_INVALID_PARAMETER; + return EFI_NOT_FOUND; } =20 PortString =3D AllocatePool (Parser->FieldData[HTTP_URI_FIELD_PORT].Leng= th + 1); if (PortString =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; @@ -1130,11 +1130,12 @@ HttpInitMsgParser ( @param[in] BodyLength Length in bytes of the Body. @param[in] Body Pointer to the buffer of the mes= sage-body to be parsed. =20 @retval EFI_SUCCESS Successfully parse the message-body. @retval EFI_INVALID_PARAMETER MsgParser is NULL or Body is NULL or = BodyLength is 0. - @retval Others Operation aborted. + @retval EFI_ABORTED Operation aborted. + @retval Other Error happened while parsing message = body. =20 **/ EFI_STATUS EFIAPI HttpParseMessageBody ( --=20 1.9.5.msysgit.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel