1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

gcoap: don't drop observer on re-register

With #9209 gCoAP got the ability to re-register and OBSERVE with a new
token, sadly the `observer` variable wasn't set in that fix, so a
re-registration actually led to the deletion of the observer (because it
is still `NULL` when the old registration is overwritten in l. 317)
This commit is contained in:
Martine Lenders 2018-05-30 23:00:13 +02:00
parent 7529133558
commit 57d3c4698c

View File

@ -291,6 +291,7 @@ static size_t _handle_req(coap_pkt_t *pdu, uint8_t *buf, size_t len,
&& _endpoints_equal(remote, resource_memo->observer)) {
/* observer re-registering with new token */
memo = resource_memo;
observer = resource_memo->observer;
}
else if ((empty_slot >= 0) && (resource_memo == NULL)) {
int obs_slot = _find_observer(&observer, remote);