Attention is currently required from: arehbein, laforge, fixeria.
2 comments:
File src/common/pcu_sock.c:
Patch Set #6, Line 990: pcu_sock_close(state);
I think this was not yet addressed?
Not sure what you are talking about arehbein. pcu_sock_send() is not creating the sturct msgb, but the caller expects it to take ownsership of the object, hence it is the duty of pcu_sock_send() to make sure the object is always freed.
Similary, osmo_wqueue_enqueue is expected to take ownsership of the message if it doesn't fail, that's what the documentation of the API states. Hence, it's pcu_sock_send() duty to free the object to avoid the leak.
Patch Set #6, Line 1106: rc = osmo_wqueue_enqueue(&state->upqueue, m);
Thanks for the reference, I'm now returning `-errno` just in case `write()` causes `errno` to be `EB […]
No, that's wrong. write() returning -EBADF doesn't mean we should return it.
-EBADF is a return code with a specific meaning the callback should return in case it frees the related object/ofd.
I wouldn't return -errno here in all cases, but rather return specific errnos based on what's needed, to avoid unexpected consequences (eg -EBADF forwarded from write() to the calle of thi function).
To view, visit change 31533. To unsubscribe, or for help writing mail filters, visit settings.