Skip to content

Commit

Permalink
Check iotivity-lite stack init before processing requests
Browse files Browse the repository at this point in the history
check if the iotivity-lite stack is initialized before
processing new requests during shutdown.
  • Loading branch information
jkralik authored and Danielius1922 committed Sep 19, 2023
1 parent 9fd739b commit 1b61468
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions messaging/coap/engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,11 @@ coap_receive_method_payload(coap_receive_ctx_t *ctx, const char *href,
}
#endif /* OC_SECURITY */

if (!oc_main_initialized()) {
COAP_DBG("cannot process new requests during shutdown iotivity-lite stack");
return COAP_RECEIVE_ERROR;
}

#ifdef OC_TCP
bool is_valid_size =
((endpoint->flags & TCP) != 0 &&
Expand Down

0 comments on commit 1b61468

Please sign in to comment.