From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=CW5kUusY; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=0110cd7420=nickle.wang@hpe.com) 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pps0720; bh=n9DE3KobBUPxb4pcB5GxWoV+zdg1p6JkmPJIWO13qL8=; b=CW5kUusY/fcrVU2viu3k55olhma1Xa4s5wkbKnWvocXdLKxd5tA+51z7GdqmPUIwiEOt AtBdXY8RWXbxv0/5Pvk8AdvdzdBE3peoQVaYVSAyDAAZpbnyOrLLj6z8Yx5PmVRWuwDw +m5cr0tIZK8vBkHi34CY7ACmu2xyWm7LRzH/izi2EVyZmqk9pXaJfbehqX/vXPVhyjRx irG8QVCPSdoS6Hh63RtGV89iheHVn1QZYV7zwfjbVwBmicITDQRTJKLqdxDskMut/eGl l5XSjl4fbgfe+4xhkkjhPQCjXW2kyN3kE6LQ8NWPOor04Faqsz51h7IGCEMhgbuKHBzz /g== 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 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-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> X-Mailer: git-send-email 2.32.0.windows.2 MIME-Version: 1.0 X-Proofpoint-GUID: wPs7U_gcNWbd4hMa0e2yrLt8u7bYOLVX X-Proofpoint-ORIG-GUID: wPs7U_gcNWbd4hMa0e2yrLt8u7bYOLVX X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-20_06,2022-04-20_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 clxscore=1015 spamscore=0 mlxlogscore=649 suspectscore=0 mlxscore=0 priorityscore=1501 adultscore=0 bulkscore=0 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204210014 Content-Transfer-Encoding: quoted-printable 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=0D =0D - (C) Copyright 2018-2021 Hewlett Packard Enterprise Development LP
=0D + (C) Copyright 2018-2022 Hewlett Packard Enterprise Development LP
=0D =0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D @@ -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)=0D {=0D json_t *JsonValue;=0D - RedfishCS_char NullStr[] =3D "";=0D RedfishCS_char *InsertStr;=0D =0D InsertStr =3D StringValue;=0D @@ -803,7 +802,7 @@ RedfishCS_status InsertJsonStringObj (json_t *ParentJso= nObj, char *Key, RedfishC return RedfishCS_status_invalid_parameter;=0D }=0D if (InsertStr =3D=3D (char *)NULL) {=0D - InsertStr =3D NullStr;=0D + return RedfishCS_status_success;=0D }=0D JsonValue =3D json_string(InsertStr);=0D if (JsonValue =3D=3D NULL) {=0D --=20 2.32.0.windows.2