#### Pre-Submission Checklist - [x] Commit message has the format required by CONTRIBUTING guide - [x] Commits are split per component (core, individual modules, libs, utils, ...) - [x] Each component has a single commit (if not, squash them into one commit) - [x] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change - [x] Small bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist: - [x] PR should be backported to stable branches - [x] Tested changes locally - [ ] Related to issue
#### Description
In `send_rtpp_command()` if socket operations fail with an error other than `EINTR` or `ENOBUFS`, the actual error is not reported - we just get a generic "Can't send command to/read reply from RTPEngine".
Other places in the module report `errno` and `strerror(errno)` using the log format "`(%s:%d)`" so added that to the error log.
Also fixed `bind_force_send_ip()` error log to use the same semantic as the other places.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3899
-- Commit Summary --
* rtpengine: show errno and error string in more places where it is useful
-- File Changes --
M src/modules/rtpengine/rtpengine.c (14)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3899.patch https://github.com/kamailio/kamailio/pull/3899.diff
@guss77 pushed 1 commit.
7d577c072b31ed8abccdffb49031723d70ce055f rtpengine: show errno and error string in more places where it is useful
I tried to match the line indentation formatting to what the CI action is showing, but it doesn't show the difference between tabs and spaces - and now I have the feeling that it showed extra indentation using spaces while all other indentation is tabs, and I overshot.
@guss77 pushed 1 commit.
da1c411f6ae165eedd1fccf7891b66de2bc844ec rtpengine: show errno and error string in more places where it is useful
You should be able to just run `clang-format` over your edited code and that should reformat it to make the format checker happy.
There are some function calls (`close()` for example) between testing the `errno` value and printing out the log line. These functions might reset `errno` to something else. You should either reorder the code so that the log printing happens immediately after testing `errno`, or save the value to an intermediary variable and then print that.
You should be able to just run `clang-format` over your edited code and that should reformat it to make the format checker happy.
I figured it out afterwards :sweat_smile:
There are some function calls (`close()` for example) between testing the `errno` value and printing out the log line. These functions might reset `errno` to something else. You should either reorder the code so that the log printing happens immediately after testing `errno`, or save the value to an intermediary variable and then print that.
I'll fix.
@guss77 pushed 1 commit.
5c2e09a354af17682f82cc769eb7e1ae130e541e rtpengine: show errno and error string in more places where it is useful
A heavier touch, but we can postpone `close(fd)` to the end and it also doesn't matter if we close needlessly - it is almost a no-op with `fd = -1`. If you disagree, I can try something else.
Merged #3899 into master.
LGTM, thanks