Commit Graph
48 Commits
Author SHA1 Message Date
Olaf Bergmann 82223d8a26 Merge branch 'master' of ssh://git.code.sf.net/p/libcoap/code 2014-06-19 15:24:00 +02:00
Olaf Bergmann 1a0e4c7880 Merge branch 'master', commit '234cf4e07472433cd7748a7d3a35519ca15fba20' of git://git.code.sf.net/u/dbjorklu/libcoap_bugfix 2014-06-19 14:43:12 +02:00
Olaf Bergmann c77c3cda32 fixed coap_iterator_next() to work on utlist structure. 2014-06-18 18:50:44 +02:00
Olaf Bergmann 978577c686 Use a generalized iterator to walk through resources. 2014-06-18 18:28:57 +02:00
Olaf Bergmann 0bef51b86f Merge branch 'master' of git://git.code.sf.net/u/dbjorklu/libcoap_bugfix 2014-05-07 18:06:00 +02:00
Dag Björklund 234cf4e074 #ifdef POSIX changed to #ifdef WITH_POSIX (allows attribs to be freed) 2014-04-04 10:40:08 +03:00
Olaf Bergmann d5dc48d97a Track local network interface for received packets.
Changed various functions to pass the local interface using the
new coap_endpoint_t abstraction. This change uses the functions
implemented earlier in commit 786ca6da (branch dcaf) but does not
use callback functions for network I/O.

This change closes bug #23 "server responds from wrong endpoint
(ipv6 address)" (POSIX only, CONTIKI and LWIP tbd).
2014-03-21 18:12:40 +01:00
Olaf Bergmann a3fae3ce3a Support cancellation of observe relationships using GET w/ Observe: 1.
Adding and removal of observes is now handled by libcoap. The application's
GET handler only needs to add the Observe option (see server.c:hnd_get_time()).
2014-03-09 02:27:52 +00:00
Olaf Bergmann 909cccd05d Support for response code 7.31 to cancel observation relationships.
This new behavior is described in Section 4.6 of draft-ietf-core-observe-12.
The idea is to send a response with code 7.31 and the token to identify
the subscription.
2014-02-25 19:00:10 +01:00
Olaf Bergmann 660deefe73 Support for block-wise transfer of /.well-known/core. 2014-02-04 17:56:31 +01:00
Olaf Bergmann f37ec9654e (Yet incomplete) support for block-wise transfer of .well-known/core.
The function wellknown_response() now honors a Block2 option when present
in the request or adds a new Block2 option to the response when the resource
description does not fit.

Bug: get_wkc_len() currently returns a hard-coded value instead of calculating
the size of the resource description (which requires changes in resource.c).
2014-01-07 23:41:15 +01:00
Olaf Bergmann 591aa06783 Support for partial output of .well-known/core
This change provides basic support for block-wise transfer of resource
descriptions. print_wellknown() now takes an additional parameter that
specifies the offset in the resource description where output shall start.
coap_print_link() has been modified to truncate resource descriptions that
do not fit in the given buffer (instead of failing with an error code as
was the case before).
2014-01-07 17:33:49 +01:00
Olaf Bergmann 78794d3385 bugfix: wrong calculation of written bytes in .well-known/core payload 2014-01-03 16:18:27 +01:00
Dag Björklund 85ea3eebc7 Only requiring an observervable resource to have a GET handler, if it is in fact an observable resource
Signed-off-by: Olaf Bergmann <bergmann@tzi.org>
2013-12-30 00:50:45 +01:00
chrysn 030e87185a implement COAP_MALLOC_TYPE on lwip
the approach fits very well with the lwippools, and only requires
minimal changes there.
2013-11-17 16:53:35 +01:00
chrysn 7359e0ca4d use lwip pools for resources and resource attributes 2013-11-17 16:53:07 +01:00
chrysn f3d98c9a2b allow having a resource list instead of a hash
this brings O(n) lookup time for resources, but allows removing dynamic
memory management
2013-11-17 16:44:34 +01:00
chrysn d573c0779a use lwip pools for observations 2013-11-17 16:43:51 +01:00
chrysn 697e13d649 non-c99 compatibility 2013-11-17 16:30:09 +01:00
chrysn c5f88316e1 allow having a resource list instead of a hash
this brings O(n) lookup time for resources, but allows removing dynamic
memory management
2013-11-17 16:28:27 +01:00
chrysn 42296f73f5 introduce partiallydirty resources and dirty subscriptions
this change spreads the concept of "dirty" from resources to
subscriptions. this allows queuing up notifications in case not all of
them can be transmitted at the same time (which can happen due to
constraints in pdu or node space).

when a dirty resource's notifications can not be sent, the resource is
marked as partiallydirty, and on the subscriptions that could not be
sent out, the dirty flag is set. they get cleared later when
coap_notify_observers gets run again, as it not only looks for dirty,
but also for partiallydirty resources.

note that there is currently no facility that prevents that all the
nodes get assigned to the send queue, leaving no room for receiving
packages (which happens in mass notifications, blocks all incoming
packages and is only resolved by the transmissions timing out). my
current test setup always leaves at least one node free for reception by
over-allocating and freeing a node on sending.
2013-11-17 16:05:35 +01:00
Olaf Bergmann accc094785 notifications and observer removal according to draft-ietf-core-observe-09 2013-07-23 17:33:03 +02:00
Olaf Bergmann 2045d377ca code cleanup in print_wellknown() 2013-02-05 15:08:57 +01:00
Olaf Bergmann 61521701d5 set token for observe notifications 2013-01-18 17:17:55 +01:00
Olaf Bergmann 54ef9fd83c Klaus-encoding and option iterators 2013-01-18 16:44:19 +01:00
Thomas Pötsch c1452c3707 fixed query filter for href attribute with leading "/" 2012-11-22 13:47:55 +01:00
Olaf Bergmann 864585b6f0 debug studd removed 2012-11-03 17:23:31 +01:00
Olaf Bergmann 20e0e490ed bugfix
make sure that only URI segments are treated in coap_hash_request_uri()
2012-11-03 17:19:51 +01:00
Thomas Pötsch f64a8390e7 fixed typo in coap_resource_t 2012-08-29 11:43:49 +02:00
Olaf Bergmann fd8c499457 bugfix: Anomalies in query filtering - ID: 3540203 (patch from John Sucaet) 2012-07-17 16:33:42 +02:00
Olaf Bergmann 799edd524c bugfix: Memory leaks in rd.c - ID: 3542467 (patch from John Sucaet) 2012-07-17 14:44:10 +02:00
Olaf Bergmann 28a6d45cde fixed bug #3524612 (Double free error when coap_send returns COAP_INVALID_TID)
From jsucaet's error description (Credits to Marc Haesen for revealing this bug):
The intent of the current code of coap_send is to release the allocated
memory upon success and not to release when an error has occured. However
this is broken (returning from coap_send with an error and a deallocated
pdu ptr is possible).
In the patch, I propose to let the calling function (of coap_send) be
responsible for free'ing the allocated pointer.
2012-05-29 19:41:22 +02:00
Olaf Bergmann c98a084626 configure options to throw out block, observe, and query-filter 2012-04-18 12:11:41 +02:00
Olaf Bergmann 44ea7c58ba attribute filters for /.well-known/core 2012-03-21 16:40:59 +01:00
Olaf Bergmann 5ac8e435dc bugfix 2012-03-07 21:00:22 +01:00
Olaf Bergmann f9e733f65d missing definitions for non-contiki platforms 2012-03-07 20:15:48 +01:00
Olaf Bergmann 0b2713d4d4 subscriptions are identified by observers' transport addresses and tokens 2012-01-19 14:18:22 +01:00
Olaf Bergmann 10c2ce6bbd support for confirmable responses to check if observers are alive 2012-01-18 13:29:50 +01:00
Olaf Bergmann 5f4209e04b observe 2012-01-13 18:43:38 +01:00
Olaf Bergmann d1e394bec8 functions required for coap-observe 2012-01-06 15:28:49 +01:00
Olaf Bergmann f7c41a85f5 bugfix 2012-01-02 21:37:39 +01:00
Olaf Bergmann 13bd84d850 print_wellknown() needs access to resource_storage structure (Contiki-specific) 2011-12-24 23:09:23 +01:00
Olaf Bergmann 1078486518 get rid of uthash and use Contiki's static memory blocks 2011-12-11 20:11:11 +01:00
Olaf Bergmann fae51d1cc9 cleaned debug stuff 2011-12-11 15:57:24 +01:00
Olaf Bergmann 15fd4ec0de Started to replace subscribe by generic async support. 2011-06-13 19:01:52 +02:00
Olaf Bergmann 904aa3b2d0 Put definition of coap_key_t and helper functions in extra file. 2011-06-11 14:10:38 +02:00
Olaf Bergmann 3cb5a81c16 minor fix 2011-06-10 18:01:10 +02:00
Olaf Bergmann 6fd54aacf7 Changed resource definition to support hash tables.
Use byte-array as hash key.
Added method handlers for GET,PUT,POST,DELETE to resource definition.
2011-06-10 17:56:14 +02:00