As a server, idle sessions are left around in case the client wants to do
further work using the same 5 tuple IP information.
With constrained systems, the number of sessions is limited, and so it is
easy to run out of sessions.
src/coap_session.c:
If there is an idle session, context->max_idle_sessions is not set and
a new session cannot be created, free off the oldest session and retry
the creation again.
examples/contiki/README:
examples/lwip/README:
Tidy up the documentation
hashkey.[ch] files restored (now prefixed with coap_)
LWIP and Contiki builds now include these files
block.[ch]:
New function coap_add_data_blocked_response() to simplify GET
responses and handle adding in BLOCK2 options as appropriate.
Needs coap_hash() to generate ETag option.
net.c:
Determine if Block2 is in use, and add to coap_add_observer().
resource.[ch]:
Include Block2 request in coap_add_observer().
subscribe.h:
Include Block2 definition in coap_subscriber_t for using during
observe responses.
pdu.h:
Update comment.
coap-client.c:
No longer causes duplicate calls to coap_show_pdu()
(one in library, one in coap-client for the same PDU).
If a block'ed response received and observing, now observing continues.
(Fixes#166).
Send Observe Cancel with Block2 option if -b defined
coap-server.c:
Replaced all option setting, data addition etc. with new
coap_add_data_blocked_response() function in the GET handlers.
(Fixes#246 Issue 2).
Support PUT with BLOCK1.
(Fixes#246 Issue 1).
Add in -N option to send observe responses as non-confirmable.
Handle small wait_ms values correctly (after being decremented) for testing
whether observe should be triggered or not.
Refresh time every second by making COAP_RESOURCE_CHECK_TIME 1
Manuals:
Add in new function coap_add_data_blocked_response()
Update coap_observe with coap_delete_observer(s) functions
Correct example typo and use new function in hnd_get_time().
Add in -N option to coap-server(5)
Be more specific about COAP_RESOURCE_FLAGS_NOTIFY_NON and
COAP_RESOURCE_FLAGS_NOTIFY_CON usage for observe.
Files:
Makefile.am
Makefile.libcoap
examples/client.c
examples/coap-server.c
examples/lwip/Makefile
include/coap/block.h
include/coap/coap_hashkey.h
include/coap/pdu.h
include/coap/resource.h
include/coap/subscribe.h
libcoap-2.map
libcoap-2.sym
man/Makefile.am
man/coap-server.txt.in
man/coap_handler.txt.in
man/coap_observe.txt.in
man/coap_pdu_setup.txt.in
man/coap_resource.txt.in
src/block.c
src/coap_hashkey.c
src/net.c
src/resource.c
Update code to use new APIs
[Some code changes modelled on PR #202, some code being moved between files]
Remove #ifdef WITH_LWIP from coap_io.c as file is not used
Add in resource time to lwip
Update for Travis build
Report on Contiki memory allocate failures to ease debugging
Make the different memory type counts configurable by using the -D option
included in a CFLAGS definition to the ./configure command line
.travis.yml
BUILDING
Makefile.libcoap
examples/contiki/Makefile
examples/contiki/README new
examples/contiki/server.c
examples/contiki/.gitignore (new)
examples/lwip/Makefile
examples/lwip/README
examples/lwip/lwipopts.h
examples/lwip/server-coap.c
examples/lwip/server.c
include/coap/address.h
include/coap/coap_io.h
include/coap/lwippools.h
include/coap/pdu.h
scripts/build.sh
src/address.c
src/coap_io.c
src/coap_io_lwip.c
src/coap_session.c
src/mem.c
src/net.c
src/pdu.c
note on coap_read removal: as the lwip implementation currently launches
the package handling right from the recv callback, a coap_read function
is not meaningful (as it is in posix or contiki where it actively
fetches the messages from the network buffer).
This drops the cumbersome mintapif mechanisms from server.c, fixes
header troubles that have popped up probably during the header cleanups,
drops old workarounds and enables IPv6.
This example now uses LwIP release 1.4.1 as the devel branch seems
to have disappeared from the git repository. Moreover, we just do
a shallow clone so maybe the server does not kick us that often.
* resolve file resolution conflicts between lwip and libcoap in favor of
lwip by rearranging the makefile
* cover the config.h of a configured base libcoap with the local one
using the deprecated -I- gcc switch
* enable etharp (no idea why it wouldn't work ootb, the complete
server.c lwip-contrib copy needs to be reviewed)
* disable optimizations for easier debugging, enable -g3 for macro
expansions