bogus error message "Warning: Sendmsg error! Strerror=Success"
When trying to send as many SCTP messages as possible (on Debian GNU/Linux) from TTCN3 via SCTPasp, I'm running into many log messages like this:
Warning: Sendmsg error! Strerror=Success
So "success" of course is not an err. Digging into this, it shows that 'errno' is evaluated way too late, after calling complex code that might modify errno compared to the original error. I have a patch for this specific instance (will submit a PR), but the problem seems more frequent in this codebase, so it would be good if somebody could review that.
So now I see that the real error is EAGAIN (Resource temporarily unavailable). So there seems to be another bug. On a non-blocking socket, the send/sendmsg/sendto/write/... calls should of course only be called when the file descriptor is actually marked as write-able. If it is not, then -EAGAIN is returned by the kernel. So I somehow have the feeling that SCTPasp doesn't seem to handle the non-blocking sockets correctly.