osaf/libs/agents/saf/lga/lga_mds.c |  26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)


The log agent on defaul branch (5.0) was not backward compatible
with the old OpenSAF versions.

This fix does an workaround to make it work.

diff --git a/osaf/libs/agents/saf/lga/lga_mds.c 
b/osaf/libs/agents/saf/lga/lga_mds.c
--- a/osaf/libs/agents/saf/lga/lga_mds.c
+++ b/osaf/libs/agents/saf/lga/lga_mds.c
@@ -139,10 +139,13 @@ static uint32_t lga_enc_lstr_open_sync_m
                TRACE("p8 NULL!!!");
                goto done;
        }
-       if (param->logFileName != NULL)
+       if (param->logFileName != NULL) {
                len = strlen(param->logFileName) + 1;
-       else
-               len = 0;
+       } else {
+               /* Workaround to keep backward compatible */
+               len = 1;
+       }
+
        ncs_encode_16bit(&p8, len);
        ncs_enc_claim_space(uba, 2);
        total_bytes += 2;
@@ -150,6 +153,10 @@ static uint32_t lga_enc_lstr_open_sync_m
        if (param->logFileName != NULL) {
                ncs_encode_n_octets_in_uba(uba, (uint8_t *)param->logFileName, 
len);
                total_bytes += len;
+       } else {
+               /* Keep backward compatible */
+               ncs_encode_n_octets_in_uba(uba, (uint8_t *)"", len);
+               total_bytes += len;
        }
 
        /* Encode logFilePathName if initiated */
@@ -158,10 +165,13 @@ static uint32_t lga_enc_lstr_open_sync_m
                TRACE("p8 NULL!!!");
                goto done;
        }
-       if (param->logFilePathName)
+       if (param->logFilePathName) {
                len = strlen(param->logFilePathName) + 1;
-       else
-               len = 0;
+       } else {
+               /* Workaround to keep backward compatible */
+               len = 1;
+       }
+
        ncs_encode_16bit(&p8, len);
        ncs_enc_claim_space(uba, 2);
        total_bytes += 2;
@@ -169,6 +179,10 @@ static uint32_t lga_enc_lstr_open_sync_m
        if (param->logFilePathName != NULL) {
                ncs_encode_n_octets_in_uba(uba, (uint8_t 
*)param->logFilePathName, len);
                total_bytes += len;
+       } else {
+               /* Workaround to keep backward compatible */
+               ncs_encode_n_octets_in_uba(uba, (uint8_t *)"", len);
+               total_bytes += len;
        }
 
        /* Encode format string if initiated */

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to