[CA] [All] URI support , Optimization , License verification
[platform/upstream/iotivity.git] / resource / csdk / connectivity / src / caprotocolmessage.c
index b49fc1a..c33cd5c 100644 (file)
@@ -180,6 +180,7 @@ coap_pdu_t *CACreatePDUforRequestWithPayload(const code_t code, coap_list_t *opt
     }\r
     for (opt = options; opt; opt = opt->next)\r
     {\r
+        OIC_LOG_V(DEBUG, TAG, "[%s] opt will be added.", COAP_OPTION_DATA(*(coap_option * )opt->data));\r
         coap_add_option(pdu, COAP_OPTION_KEY(*(coap_option * )opt->data),\r
                         COAP_OPTION_LENGTH(*(coap_option * )opt->data),\r
                         COAP_OPTION_DATA(*(coap_option * )opt->data));\r
@@ -459,14 +460,16 @@ void CAGetRequestPDUInfo(const coap_pdu_t *pdu, uint32_t *outCode, CAInfo_t *out
                             COAP_OPT_LENGTH(option), (uint8_t *)buf, sizeof(buf),\r
                             encode))\r
         {\r
+            OIC_LOG_V(DEBUG, TAG, "COAP URI element : %s", buf);\r
             if (COAP_OPTION_URI_PATH == opt_iter.type || COAP_OPTION_URI_QUERY == opt_iter.type)\r
             {\r
                 if (0 == isfirstsetflag)\r
                 {\r
                     isfirstsetflag = 1;\r
+                    memcpy(optionResult + optionLength, "/", 1);\r
+                    optionLength++;\r
                     memcpy(optionResult + optionLength, buf, strlen((const char *) buf));\r
                     optionLength += strlen((const char *) buf);\r
-\r
                 }\r
                 else\r
                 {\r
@@ -486,7 +489,6 @@ void CAGetRequestPDUInfo(const coap_pdu_t *pdu, uint32_t *outCode, CAInfo_t *out
             }\r
             else\r
             {\r
-\r
                 if (idx < count)\r
                 {\r
                     uint32_t length = (uint32_t) strlen((const char *) buf);\r