Commit d92b91b5 authored by jnashok's avatar jnashok Committed by Erich Keane

Removing unnecessary code for ca samples

after recent ipv6 plumbing changes, this code is not used
hence removing the unused code

Change-Id: I0e3b0cd1aee394fcba2a35f0021ed3a2f7068352
Signed-off-by: default avatarjnashok <jn.ashok@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1630Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarHyuna Jo <hyuna0213.jo@samsung.com>
Reviewed-by: default avatarErich Keane <erich.keane@intel.com>
parent a9f649f8
......@@ -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);
}
}
}
......
......@@ -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);
}
}
......
......@@ -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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment