Closed agordon closed 10 years ago
Not sure I understood your message.
I see three code paths:
Case 1 is not modified by this patch.
Case 2 remains the same, the message limit is still 400 bytes,.
Case 3 is the modified one, "myopenlog" modifies the limit, and sets it to SO_SNDBUF. later, mysyslog() takes the minimum between MAX_LINE and SO_SNDBUF - so which ever is lower is the limit. In the current code (without this patch), case 3 is also limited to 400 bytes.
Do you see a problem with this on your system?
In case 3, if the socket is a stream, the max line length will be limited to the send buffer of that socket. This appears to needlessly trim the message since the send buffer could be less than the max line and the transport is reliable.
Ah, I see.
From a theoretical point-of-view, you are correct. I'll send a better patch.
From the real-code point-of-view, case 3 was always limited to 400 characters, so it didn't matter :)
Certainly agree this is better than it was before. Just wanted to make sure it wasn't limiting anything else :)
Here's a better version.
Looks like this will impose the SO_SNDBUF limit on non DGRAM sockets, which should cover the current 64k limit that is there now but not beyond that (at least on my system).