bug fix - publish default (oic/d oic/p) 22/161022/1
authorhhk86.heo <hhk86.heo@samsung.com>
Tue, 21 Nov 2017 05:57:09 +0000 (14:57 +0900)
committerhhk86.heo <hhk86.heo@samsung.com>
Tue, 21 Nov 2017 05:57:09 +0000 (14:57 +0900)
Change-Id: I1098320448c47625a1f50829d7d5d533a07ef76c

src/fmw_update_service_internal.c

index 75debe104e80dfc71487bb33a1d9574693b1e683..9aae06fca925005d8c682e63615b3e10581947ab 100644 (file)
@@ -887,10 +887,19 @@ int _publish_res_to_rd()
        _lock_and_wait();
 
 #else
-       if (OCRDPublish(NULL, uri, CT_ADAPTER_TCP|CT_IP_USE_V4,
-                       res_handle, 2,
-//                     &cb_data, OIC_RD_PUBLISH_TTL, OC_LOW_QOS) != OC_STACK_OK) {
-                       &cb_data, OC_LOW_QOS) != OC_STACK_OK) {
+
+       int ocResult = OC_STACK_OK;
+       ocResult = OCRDPublish(NULL, uri, (CT_ADAPTER_TCP | CT_IP_USE_V4), NULL, 0, &cb_data, OC_LOW_QOS);
+       if (ocResult != OC_STACK_OK) {
+               FWR_LOGD("Publish Resource with null handle failed [%d]", ocResult);
+               return -1;
+       }
+       _lock_and_wait();
+
+       ocResult = (OCRDPublish(NULL, uri, CT_ADAPTER_TCP|CT_IP_USE_V4, res_handle, 2,
+//                     &cb_data, OIC_RD_PUBLISH_TTL, OC_LOW_QOS) != OC_STACK_OK)
+                       &cb_data, OC_LOW_QOS) != OC_STACK_OK);
+       if (ocResult != OC_STACK_OK) {
                FWR_LOGD("OCRDPublish() failed\n");
                return -1;
        }