Re: [edk2-devel] [edk2-staging][PATCH] edk2-staging/RedfishClientPkg: Do not create attribute for NULL object
Merged! > -Original Message- > From: devel@edk2.groups.io On Behalf Of Abner > Chang > Sent: Thursday, April 21, 2022 12:57 PM > To: devel@edk2.groups.io; Wang, Nickle (Server BIOS) > > Cc: Chang, Abner (HPS SW/FW Technologist) > Subject: Re: [edk2-devel] [edk2-staging][PATCH] edk2- > staging/RedfishClientPkg: Do not create attribute for NULL object > > I will merge it. Thanks > > Reviewed-by: Abner Chang > > > > -Original Message- > > From: devel@edk2.groups.io On Behalf Of Wang, > > Nickle (Server BIOS) > > Sent: Thursday, April 21, 2022 11:16 AM > > To: devel@edk2.groups.io > > Cc: Wang, Nickle (Server BIOS) ; Chang, Abner > (HPS > > SW/FW Technologist) > > Subject: [edk2-devel] [edk2-staging][PATCH] edk2- > staging/RedfishClientPkg: > > Do not create attribute for NULL object > > > > 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/RedfishClientPkg/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 > > > > - (C) Copyright 2018-2021 Hewlett Packard Enterprise Development > LP > > + (C) Copyright 2018-2022 Hewlett Packard Enterprise Development > LP > > > >SPDX-License-Identifier: BSD-2-Clause-Patent > > > > @@ -795,7 +795,6 @@ RedfishCS_status GetRedfishPropertyVague (void > > *Cs, json_t *JsonObj, char *Key, > > RedfishCS_status InsertJsonStringObj (json_t *ParentJsonObj, char *Key, > > RedfishCS_char *StringValue) > > { > >json_t *JsonValue; > > - RedfishCS_char NullStr[] = ""; > >RedfishCS_char *InsertStr; > > > >InsertStr = StringValue; > > @@ -803,7 +802,7 @@ RedfishCS_status InsertJsonStringObj (json_t > > *ParentJsonObj, char *Key, RedfishC > > return RedfishCS_status_invalid_parameter; > >} > >if (InsertStr == (char *)NULL) { > > -InsertStr = NullStr; > > +return RedfishCS_status_success; > >} > >JsonValue = json_string(InsertStr); > >if (JsonValue == NULL) { > > -- > > 2.32.0.windows.2 > > > > > > > > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#89175): https://edk2.groups.io/g/devel/message/89175 Mute This Topic: https://groups.io/mt/90599292/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-staging][PATCH] edk2-staging/RedfishClientPkg: Do not create attribute for NULL object
I will merge it. Thanks Reviewed-by: Abner Chang > -Original Message- > From: devel@edk2.groups.io On Behalf Of Wang, > Nickle (Server BIOS) > Sent: Thursday, April 21, 2022 11:16 AM > To: devel@edk2.groups.io > Cc: Wang, Nickle (Server BIOS) ; Chang, Abner (HPS > SW/FW Technologist) > Subject: [edk2-devel] [edk2-staging][PATCH] edk2-staging/RedfishClientPkg: > Do not create attribute for NULL object > > 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/RedfishClientPkg/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 > > - (C) Copyright 2018-2021 Hewlett Packard Enterprise Development LP > + (C) Copyright 2018-2022 Hewlett Packard Enterprise Development LP > >SPDX-License-Identifier: BSD-2-Clause-Patent > > @@ -795,7 +795,6 @@ RedfishCS_status GetRedfishPropertyVague (void > *Cs, json_t *JsonObj, char *Key, > RedfishCS_status InsertJsonStringObj (json_t *ParentJsonObj, char *Key, > RedfishCS_char *StringValue) > { >json_t *JsonValue; > - RedfishCS_char NullStr[] = ""; >RedfishCS_char *InsertStr; > >InsertStr = StringValue; > @@ -803,7 +802,7 @@ RedfishCS_status InsertJsonStringObj (json_t > *ParentJsonObj, char *Key, RedfishC > return RedfishCS_status_invalid_parameter; >} >if (InsertStr == (char *)NULL) { > -InsertStr = NullStr; > +return RedfishCS_status_success; >} >JsonValue = json_string(InsertStr); >if (JsonValue == NULL) { > -- > 2.32.0.windows.2 > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#89172): https://edk2.groups.io/g/devel/message/89172 Mute This Topic: https://groups.io/mt/90599292/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-staging][PATCH] edk2-staging/RedfishClientPkg: Do not create attribute for NULL object
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/RedfishClientPkg/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 - (C) Copyright 2018-2021 Hewlett Packard Enterprise Development LP + (C) Copyright 2018-2022 Hewlett Packard Enterprise Development LP SPDX-License-Identifier: BSD-2-Clause-Patent @@ -795,7 +795,6 @@ RedfishCS_status GetRedfishPropertyVague (void *Cs, json_t *JsonObj, char *Key, RedfishCS_status InsertJsonStringObj (json_t *ParentJsonObj, char *Key, RedfishCS_char *StringValue) { json_t *JsonValue; - RedfishCS_char NullStr[] = ""; RedfishCS_char *InsertStr; InsertStr = StringValue; @@ -803,7 +802,7 @@ RedfishCS_status InsertJsonStringObj (json_t *ParentJsonObj, char *Key, RedfishC return RedfishCS_status_invalid_parameter; } if (InsertStr == (char *)NULL) { -InsertStr = NullStr; +return RedfishCS_status_success; } JsonValue = json_string(InsertStr); if (JsonValue == NULL) { -- 2.32.0.windows.2 -=-=-=-=-=-=-=-=-=-=-=- 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/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-