@miconda commented on this pull request.


> @@ -102,15 +102,14 @@ static int add_contact(str aor, ucontact_info_t *ci)
 
        dmq_ul.lock_udomain(_d, &aor);
        res = dmq_ul.get_urecord(_d, &aor, &r);
-       if(res < 0) {
-               LM_ERR("failed to retrieve record from usrloc\n");
-               goto error;
-       } else if(res == 0) {
+       // res can be only 0 or 1

It should be no comment listing the return codes of a function when the 
function is executed, because it can be executed in many places  and it is hard 
to keep it a coherent approach everywhere, furthermore, over the time the 
function can be updated and such comments are usually left unchanged, 
misleading. 

The docs about what a function returns have to be where the function is 
defined, so one can jump to it in the sources and read about.

>               LM_DBG("'%.*s' found in usrloc\n", aor.len, ZSW(aor.s));
                res = dmq_ul.get_ucontact(r, ci->c, ci->callid, ci->path, 
ci->cseq, &c);
                LM_DBG("get_ucontact = %d\n", res);
-               if(res == -1) {
-                       LM_ERR("Invalid cseq\n");
+               // res can be -2, -1, 0 or 1

Same comment as above here.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4593#pullrequestreview-3818925210
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/pull/4593/review/[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!

Reply via email to