Attention is currently required from: osmith, laforge, fixeria.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/34089 )
Change subject: ss7: Use libosmo-netif's osmo_stream_{cli,srv}_recv() APIs ......................................................................
Patch Set 1:
(2 comments)
File src/osmo_ss7.c:
https://gerrit.osmocom.org/c/libosmo-sccp/+/34089/comment/615ea90e_ef7bdc8a PS1, Line 1951: rc = 0;
What if rc == -EAGAIN, do you want it to be set to 0? (probably, but just to be sure)
Yes, this is fine, we just clear any error code (like -EBADF) which may trigger stuff in the callback caller. It's totally fine returning 0 instead of EAGAIN here, since we already did whatever we had to do (and the READ flag is still set so poll will trigger again if the kernel finds out the socket has somethig else for us).
https://gerrit.osmocom.org/c/libosmo-sccp/+/34089/comment/76ce9aee_f6c97fe0 PS1, Line 1954: if (rc < 0) {
why not if (rc <= 0) {? […]
I prefer keeping the 2 scenarios separate, even if we end up doing the same right now. In the future we may want to check for specific errors in this path.