Updated security sample apps to add "/" in front of resource URI.
authorSachin Agrawal <sachin.agrawal@intel.com>
Sun, 21 Dec 2014 23:48:39 +0000 (15:48 -0800)
committerSachin Agrawal <sachin.agrawal@intel.com>
Sun, 21 Dec 2014 23:48:39 +0000 (15:48 -0800)
Gerrit Review 712 in 01.org updated CA layer to mandate "/" in front
of resource URI's. Current change updates security sample apps
to co-exist with 712 change.

Change-Id: I133eeab9092aac9d74f536065f5e10e91f621a4e
Signed-off-by: Sachin Agrawal <sachin.agrawal@intel.com>
resource/csdk/stack/samples/linux/secure/occlientbasicops.cpp
resource/csdk/stack/samples/linux/secure/ocserverbasicops.cpp

index 047370e..ce051d0 100644 (file)
@@ -185,11 +185,7 @@ int InitPutRequest()
     OC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
     std::ostringstream query;
     query << (coapSecureResource ? "coaps://" : "coap://") << coapServerIP
-        << ":" << coapServerPort
-#ifdef CA_INT_DTLS
-        << "/"
-#endif
-        << coapServerResource;
+        << ":" << coapServerPort  << coapServerResource;
     return (InvokeOCDoResource(query, OC_REST_PUT, OC_LOW_QOS, putReqCB, NULL, 0));
 }
 
@@ -231,11 +227,7 @@ int InitGetRequest(OCQualityOfService qos)
     OC_LOG_V(INFO, TAG, "\n\nExecuting %s", __func__);
     std::ostringstream query;
     query << (coapSecureResource ? "coaps://" : "coap://") << coapServerIP
-        << ":" << coapServerPort
-#ifdef CA_INT_DTLS
-        << "/"
-#endif
-        << coapServerResource;
+        << ":" << coapServerPort << coapServerResource;
 
     return (InvokeOCDoResource(query, OC_REST_GET, (qos == OC_HIGH_QOS)?
             OC_HIGH_QOS:OC_LOW_QOS, getReqCB, NULL, 0));
index 5701184..216268b 100644 (file)
@@ -39,11 +39,7 @@ static int gCurrLedInstance = 0;
 #define SAMPLE_MAX_NUM_POST_INSTANCE  2
 static LEDResource gLedInstance[SAMPLE_MAX_NUM_POST_INSTANCE];
 
-#ifdef CA_INT_DTLS
-char *gResourceUri= (char *)"a/led";
-#else
 char *gResourceUri= (char *)"/a/led";
-#endif
 
 static uint16_t OC_WELL_KNOWN_PORT = 5683;