|
@@ -1053,18 +1053,23 @@ ssize_t inet_sendto(int s, const void *msg, size_t len, int flags,
|
1053
|
1053
|
ssize_t err;
|
1054
|
1054
|
fd_set fdset;
|
1055
|
1055
|
int ret;
|
1056
|
|
- int errno_int;
|
1057
|
|
-
|
|
1056
|
+
|
|
1057
|
+ error("Socket: %i Data: %p Data Length: %u Flags: %i Address: %p Address Length: %u", s, msg, len, flags, to, tolen);
|
|
1058
|
+
|
1058
|
1059
|
if((err=sendto(s, msg, len, flags, to, tolen))==-1) {
|
1059
|
|
- errno_int = errno;
|
1060
|
1060
|
error("sendto errno: %d err is: %d", errno, err);
|
1061
|
|
- switch(errno_int)
|
|
1061
|
+ switch(errno)
|
1062
|
1062
|
{
|
1063
|
1063
|
case EMSGSIZE:
|
1064
|
1064
|
error("Packet artificially fragmented: %d", stderr);
|
1065
|
|
- inet_sendto(s, msg, len/2, flags, to, tolen);
|
1066
|
|
- err=inet_sendto(s, ((const char *)msg+(len/2)),
|
1067
|
|
- len-(len/2), flags, to, tolen);
|
|
1065
|
+ error("\nData Length: %u", len);
|
|
1066
|
+ int bytesleft = len;
|
|
1067
|
+ while(bytesleft > 1024) {
|
|
1068
|
+ inet_sendto(s, msg, 1024, flags, to, tolen);
|
|
1069
|
+ bytesleft -= 1024;
|
|
1070
|
+ //err=inet_sendto(s, ((const char *)msg+(len/2)),
|
|
1071
|
+ //len-(len/2), flags, to, tolen);
|
|
1072
|
+ }
|
1068
|
1073
|
break;
|
1069
|
1074
|
case EFAULT:
|
1070
|
1075
|
error("The value of to is: %d", to);
|