mirror of
https://github.com/ChronosX88/netsukuku.git
synced 2024-11-25 19:52:19 +00:00
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:
parent
5d49293e08
commit
719232b6f9
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user