From efb6414291c244a0443c6891e8aada4081986977 Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Sat, 23 Oct 2010 23:18:44 +0200 Subject: [PATCH] support for resource descriptions --- subscribe.c | 6 ++++-- subscribe.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/subscribe.c b/subscribe.c index 26687c1f..9799fe04 100644 --- a/subscribe.c +++ b/subscribe.c @@ -179,8 +179,10 @@ coap_check_subscriptions(coap_context_t *context) { void coap_free_resource(void *res) { - if ( res ) - coap_free( ((coap_resource_t *)res)->uri ); + if ( res ) { + coap_free(((coap_resource_t *)res)->uri); + coap_delete_string(((coap_resource_t *)res)->name); + } } coap_key_t diff --git a/subscribe.h b/subscribe.h index 2a4a646a..bf05ae7e 100644 --- a/subscribe.h +++ b/subscribe.h @@ -35,6 +35,7 @@ typedef unsigned long coap_key_t; typedef struct { coap_uri_t *uri; /* unique identifier; memory is released by coap_delete_resource() */ + str *name; /* display name of the resource */ unsigned char mediatype; /* media type for resource representation */ unsigned int dirty:1; /* set to 1 if resource has changed */ unsigned int writable:1; /* set to 1 if resource can be changed using PUT */