Fraunhofer-IIS / libjapi

libjapi is a universal JSON to C API library. It receives newline-delimited JSON (NDJSON) messages via TCP and calls registered C functions. A JSON response is returned for each request. Furthermore, it is also possible to create push services, which asynchronously push JSON messages to the clients subscribed to them.
MIT License
3 stars 1 forks source link

Different behavior of push services in debug and relaese mode #42

Closed fraunhofer-iis-bot closed 1 year ago

fraunhofer-iis-bot commented 1 year ago

In GitLab by @bmi on Mar 29, 2023, 11:25

The error occurs when trying to perform a subscription/unsubscription to a service that does not exist

japi_pushsrv_subscribe line 149, this behaviour is allowed and will capture later in the code with an error message but in debug mode the Assertion will brake the program

the same problem exist with unsubscribe

fraunhofer-iis-bot commented 1 year ago

In GitLab by @vornkat-iis on Jul 2, 2023, 21:56

I think this is intended by the original author. The assert function used in many functions does nothing in release mode but catches bad parameters early in execution while debugging. See also https://cplusplus.com/reference/cassert/assert/

fraunhofer-iis-bot commented 1 year ago

In GitLab by @vornkat-iis on Jul 4, 2023, 14:02

created branch 42-different-behavior-of-push-services-in-debug-and-relese-mode to address this issue