miconda left a comment (kamailio/kamailio#4449)
The description of the commit lists return 0, which should not be done by a
module config function because it stops config execution -- this as a note,
because it seems the code is returning negative and positive int values. But I
would suggest to add explicit values to the enum fields, not only the -7 and 1,
it should be safer in the future and easier to understand when looking at the
code, avoiding shifting values when a new field might be added:
```
typedef enum check_flow_retcode
{
CHECK_FLOW_ERROR_HEADERS_PARSE = -7,
CHECK_FLOW_ERROR_ROUTE_PARSE,
CHECK_FLOW_EXPIRED,
CHECK_FLOW_NO_TCP_CONNECTION,
CHECK_FLOW_ERROR_DECODE,
CHECK_FLOW_ERROR_NO_FLOW_TOKEN,
CHECK_FLOW_ERROR_URI_NOT_MYSELF,
CHECK_FLOW_NO_ROUTE_HEADER = 1,
CHECK_FLOW_SUCCESS
} check_flow_retcode_t;
```
Then, in my opinion CHECK_FLOW_NO_ROUTE_HEADER belongs better to the
negative/failure range (false in native scripting), and have only
CHECK_FLOW_SUCCESS as positive/success (true).
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4449#issuecomment-3481330491
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4449/[email protected]>_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the
sender!