rsyslog / librelp

OFFICIAL librelp repository on github
https://www.rsyslog.com/librelp/
GNU General Public License v3.0
30 stars 36 forks source link

rest of the aix fixes #249

Closed kortemik closed 1 year ago

rgerhards commented 1 year ago

Please add a commit text describing why this fix is needed (or let @alorbach know so that we can update the commit).

kortemik commented 1 year ago

Thank you for letting me know. According to the man pages.

For connect

For recv

Now that I double check EINPROGRESS is not valid for recv according to the man page.

AIX seems to use EINTR to make calls non-blocking eagarly.

The case errno being 0 but return value being <0 is unknown to me. I can of course double check it because it looks quite off.

kortemik commented 1 year ago

@rgerhards @alorbach I verified the manpages, they do not say that EINPROGRESS is valid for recv however reality seems to be different so either the manpages do not match the actual behaviour or the memory has leaked and the program is not working as it should. i can only confirm that the librelp works with all the changes included in this pr. side effects are still that on connecting it prints

rsyslogd: omrelp[10.243.64.6:601]: error 'error connecting: 'Bad file number'', object  'conn to srvr 10.243.64.6:601' - action may not work as intended [v8.2110.0.master try https://www.rsyslog.com/e/2353 ]
rsyslogd: omrelp[10.243.64.6:601]: error 'error opening connection to remote peer', object  'conn to srvr 10.243.64.6:601' - action may not work as intended [v8.2110.0.master try https://www.rsyslog.com/e/2353 ]

However after a retry it connects just fine. "Bad file number" (errno 9) says on the man page of connect that EBADF (errno 9) is thrown when Socket parameter is not valid. I could not figure out why it happens, and it only happens on the first connect, not on reconnects.

kortemik commented 1 year ago

closing as duplicate of #251 , errno being EINPROGRESS seems to be due to the assignment while they should rather be checked, I pr'd the fix into the #251 upstream.