From ca5497dfe8b63d9f368065e53f214c0d17257865 Mon Sep 17 00:00:00 2001 From: Otavio Pontes Date: Tue, 1 Dec 2015 11:12:30 -0200 Subject: [PATCH] oic: Call callback when timeout is reached In sol_oic_client_get_server_info, callback needs to be called when timeout is reached, so users can perform any cleaning operation. This is the same behavior from other equivalent methods, as sol_oic_client_find_resource() Signed-off-by: Otavio Pontes --- src/lib/comms/sol-oic-client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/comms/sol-oic-client.c b/src/lib/comms/sol-oic-client.c index ff0271538..b34233900 100644 --- a/src/lib/comms/sol-oic-client.c +++ b/src/lib/comms/sol-oic-client.c @@ -333,8 +333,10 @@ _server_info_reply_cb(struct sol_coap_server *server, uint16_t payload_len; struct sol_oic_server_information info = { 0 }; - if (!req || !cliaddr) + if (!req || !cliaddr) { + ctx->cb(ctx->client, NULL, ctx->data); goto free_ctx; + } if (!ctx->cb) { SOL_WRN("No user callback provided");