From nobody Wed May 15 18:21:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+89171+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89171+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1650510989; cv=none; d=zohomail.com; s=zohoarc; b=nNNbt0Ie9t2UvV6L4w/6yW1RaFCQZmqZVWF1oI0g3wsFv5PcW78nslfJkn21Y67WDuX1j52Jjy4yXe0dLE/MTpsEUwfRUHBFs61Yp0HPIq+N5GWV8JRMJ9EO8uFHnmzN/bMMxPhKEnItc5QgyJsJH4p7uLWa1PKL/SFrCxG5VYk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650510989; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=0uiyYOqrWHZe8b7Gi0Dfj6t4NbQBHWJ0rzpVz8+exSs=; b=Cmss0LBLF0ppfdaUTBS7h0CGL35D3WoBrGv2hOhj57L22vYgNmheHZV6YS2q4sDtbkdQWP+8jLLcEjBx5hBtbuMXwBAKpWQZSD6FBPZVogzYCMZcxwCDSYOXGDk1saq1J6vblrIpZZ/HYhtj7UCru+zH3gkNEXX9WROdbACpYL4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89171+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 165051098970994.96685783963244; Wed, 20 Apr 2022 20:16:29 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id x80DYY1788612x8Y6m82hO8k; Wed, 20 Apr 2022 20:16:29 -0700 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web08.17116.1650510988701099579 for ; Wed, 20 Apr 2022 20:16:28 -0700 X-Received: from pps.filterd (m0150241.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 23KJ0Euw002226 for ; Thu, 21 Apr 2022 03:16:28 GMT X-Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) by mx0a-002e3701.pphosted.com (PPS) with ESMTPS id 3fjqxnawt3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 21 Apr 2022 03:16:27 +0000 X-Received: from WAFM3XJD5N.asiapacific.hpqcorp.net (unknown [16.242.173.211]) by g2t2353.austin.hpe.com (Postfix) with ESMTP id EDB5F89; Thu, 21 Apr 2022 03:16:24 +0000 (UTC) From: "Nickle Wang" To: devel@edk2.groups.io Cc: Nickle Wang , Abner Chang Subject: [edk2-devel] [edk2-staging][PATCH] edk2-staging/RedfishClientPkg: Do not create attribute for NULL object Date: Thu, 21 Apr 2022 11:16:00 +0800 Message-Id: <20220421031600.1570-1-nickle.wang@hpe.com> MIME-Version: 1.0 X-Proofpoint-GUID: wPs7U_gcNWbd4hMa0e2yrLt8u7bYOLVX X-Proofpoint-ORIG-GUID: wPs7U_gcNWbd4hMa0e2yrLt8u7bYOLVX X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nickle.wang@hpe.com X-Gm-Message-State: eEWIGdFRK2ic1a92f5WNs01xx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650510989; bh=0xx28VUawn+MCbWbOL0bDIJ+MrvYVacVqx/ENvym4Ag=; h=Cc:Date:From:Reply-To:Subject:To; b=d7KQ5URJJR+aRF4d+JAXmC0XssXtnks9bu5PN2d9cohCwo4wDxg0dsCk/O1FKUYrnDN n52qlEkqPJn4mEhVlY5IGwzSAAsMDpHs9PMcDPhmTGQzFBGtjevYTm/EbfsoZykHTR1TI U6ZyvwhpcS7k0vE/Z3R7mivXHZbYG8Hs1BU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650510990189100001 Content-Type: text/plain; charset="utf-8" While input object is NULL, do not generate attribute with empty string value. This can reduce the size of HTTP context while sending "PATCH" or "POST" request to Redfish service. Signed-off-by: Nickle Wang Cc: Abner Chang --- RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c b/RedfishC= lientPkg/ConverterLib/src/RedfishCsCommon.c index 624314a8ec..02e4c50c5f 100644 --- a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c +++ b/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c @@ -1,6 +1,6 @@ /** @file =20 - (C) Copyright 2018-2021 Hewlett Packard Enterprise Development LP
+ (C) Copyright 2018-2022 Hewlett Packard Enterprise Development LP
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -795,7 +795,6 @@ RedfishCS_status GetRedfishPropertyVague (void *Cs, jso= n_t *JsonObj, char *Key, RedfishCS_status InsertJsonStringObj (json_t *ParentJsonObj, char *Key, Re= dfishCS_char *StringValue) { json_t *JsonValue; - RedfishCS_char NullStr[] =3D ""; RedfishCS_char *InsertStr; =20 InsertStr =3D StringValue; @@ -803,7 +802,7 @@ RedfishCS_status InsertJsonStringObj (json_t *ParentJso= nObj, char *Key, RedfishC return RedfishCS_status_invalid_parameter; } if (InsertStr =3D=3D (char *)NULL) { - InsertStr =3D NullStr; + return RedfishCS_status_success; } JsonValue =3D json_string(InsertStr); if (JsonValue =3D=3D NULL) { --=20 2.32.0.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#89171): https://edk2.groups.io/g/devel/message/89171 Mute This Topic: https://groups.io/mt/90599292/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-