From 719232b6f9b91fbea0f612120ec4cef71c2b2508 Mon Sep 17 00:00:00 2001 From: Valeska Date: Sun, 21 Sep 2014 16:15:48 -0700 Subject: [PATCH] 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. --- src/inet.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/inet.c b/src/inet.c index 81d54c2..a90e0e3 100644 --- a/src/inet.c +++ b/src/inet.c @@ -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),