A comment to explain how inet_send works with the EMSGSIZE case.

I almost made a very complicated and unneeded change instead of just leaving it as it is because I didn't think of this. So I want this to be here so everyone can understand how this works.
This commit is contained in:
Valeska 2014-09-21 16:15:48 -07:00
parent 5d49293e08
commit 719232b6f9

View File

@ -1003,6 +1003,10 @@ ssize_t inet_send(int s, const void *msg, size_t len, int flags)
if((err=send(s, msg, len, flags)) < 0) {
switch(errno)
{
/* This divides the length of a packet if it is too large to send,
* it then sends the first half, And then the second half.
* If it is too large to send again, When it tries to send the first half
* it will just come back here to repeat the process as needed. */
case EMSGSIZE:
inet_send(s, msg, len/2, flags);
err=inet_send(s, (const char *)msg+(len/2),