Removing unnecessary code for ca samples
authorjnashok <jn.ashok@samsung.com>
Mon, 13 Jul 2015 06:55:10 +0000 (15:55 +0900)
committerErich Keane <erich.keane@intel.com>
Thu, 16 Jul 2015 06:49:24 +0000 (06:49 +0000)
after recent ipv6 plumbing changes, this code is not used
hence removing the unused code

Change-Id: I0e3b0cd1aee394fcba2a35f0021ed3a2f7068352
Signed-off-by: jnashok <jn.ashok@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1630
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Hyuna Jo <hyuna0213.jo@samsung.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/connectivity/samples/android/sample_service/jni/ResourceModel.c
resource/csdk/connectivity/samples/linux/sample_main.c
resource/csdk/connectivity/samples/tizen/casample.c

index 3c00394..3e1280f 100644 (file)
@@ -969,35 +969,15 @@ void request_handler(const CAEndpoint_t* object, const CARequestInfo_t* requestI
         if (0 < securePort) //Set the remote endpoint secure details and send response
         {
             LOGI("This is secure resource...");
-            char *uri = NULL;
-            uint32_t length = 0;
-
-            length = COAPS_PREFIX_LEN; //length of "coaps://"
-            // length of "ipaddress:port"
-            length += strlen(object->addr) + PORT_LENGTH;
-            length += strlen(requestInfo->info.resourceUri) + 1;
-
-            uri = calloc(1, sizeof(char) * length);
-            if (!uri)
-            {
-                LOGE("Failed to create new uri");
-                free(uri);
-                return;
-            }
-            sprintf(uri, "%s%s:%d/%s", COAPS_PREFIX, object->addr,
-                    securePort, requestInfo->info.resourceUri);
 
             CAEndpoint_t *endpoint = NULL;
             if (CA_STATUS_OK != CACreateEndpoint(CA_SECURE,
                         object->adapter, object->addr, securePort, &endpoint))
             {
                 LOGE("Failed to create duplicate of remote endpoint!");
-                free(uri);
                 return;
             }
             object = endpoint;
-
-            free(uri);
         }
     }
 }
index 79c0c36..edfe4ef 100644 (file)
@@ -983,34 +983,15 @@ void request_handler(const CAEndpoint_t *object, const CARequestInfo_t *requestI
         {
             printf("This is secure resource...\n");
 
-            //length of "coaps://"
-            size_t length = COAPS_PREFIX_LEN;
-
-            // length of "ipaddress:port"
-            length += strlen(object->addr) + PORT_LENGTH;
-            length += 1;
-
-            char *uri = calloc(1, sizeof(char) * length);
-            if (!uri)
-            {
-                printf("Failed to create new uri\n");
-                return;
-            }
-            sprintf(uri, "%s%s:%d/", COAPS_PREFIX, object->addr,
-                    object->port);
-
             CAEndpoint_t *endpoint = NULL;
             if (CA_STATUS_OK != CACreateEndpoint(0, object->adapter, object->addr,
                                                  object->port, &endpoint))
             {
                 printf("Failed to create duplicate of remote endpoint!\n");
-                free(uri);
                 return;
             }
             endpoint->flags = CA_SECURE;
             object = endpoint;
-
-            free(uri);
         }
     }
 
index 9e83604..d8f80cf 100644 (file)
@@ -1012,16 +1012,6 @@ void request_handler(const CAEndpoint_t *object, const CARequestInfo_t *requestI
         {
             printf("This is secure resource...\n");
 
-            //length of "coaps://"
-            size_t length = sizeof(SECURE_COAPS_PREFIX) - 1;
-
-            // length of "ipaddress:port"
-            length += strlen(object->addr) + PORT_LENGTH;
-            length += 1;
-
-            printf("%s%s:%d/", SECURE_COAPS_PREFIX, object->addr,
-                    object->port);
-
             CAEndpoint_t *endpoint = NULL;
             if (CA_STATUS_OK != CACreateEndpoint(0, object->adapter, object->addr,
                                                  object->port, &endpoint))