mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-31 00:23:58 +00:00
Some buffer tuning.
This commit is contained in:
parent
3acd901c88
commit
2fcc344299
@ -669,11 +669,7 @@
|
||||
/**
|
||||
* Desired buffer size for UDP sockets (used in service and osdep but defined here)
|
||||
*/
|
||||
#if (defined(__amd64) || defined(__amd64__) || defined(__x86_64) || defined(__x86_64__) || defined(__AMD64) || defined(__AMD64__))
|
||||
#define ZT_UDP_DESIRED_BUF_SIZE 1048576
|
||||
#else
|
||||
#define ZT_UDP_DESIRED_BUF_SIZE 131072
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Desired / recommended min stack size for threads (used on some platforms to reset thread stack size)
|
||||
|
@ -277,17 +277,14 @@ LinuxEthernetTap::LinuxEthernetTap(
|
||||
if (_enabled) {
|
||||
_tapq.post(std::pair<void *,int>(buf,r));
|
||||
buf = nullptr;
|
||||
/*
|
||||
to.setTo(getBuf,6);
|
||||
from.setTo(getBuf + 6,6);
|
||||
unsigned int etherType = ntohs(((const uint16_t *)getBuf)[6]);
|
||||
_handler(_arg,(void *)0,_nwid,from,to,etherType,0,(const void *)(getBuf + 14),r - 14);
|
||||
*/
|
||||
}
|
||||
|
||||
r = 0;
|
||||
}
|
||||
} else break; // return to outer select when read() fails
|
||||
} else {
|
||||
r = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -351,14 +351,14 @@ public:
|
||||
int tmpbs = bs;
|
||||
if (setsockopt(s,SOL_SOCKET,SO_RCVBUF,(const char *)&tmpbs,sizeof(tmpbs)) == 0)
|
||||
break;
|
||||
bs -= 16384;
|
||||
bs -= 4096;
|
||||
}
|
||||
bs = bufferSize;
|
||||
while (bs >= 65536) {
|
||||
int tmpbs = bs;
|
||||
if (setsockopt(s,SOL_SOCKET,SO_SNDBUF,(const char *)&tmpbs,sizeof(tmpbs)) == 0)
|
||||
break;
|
||||
bs -= 16384;
|
||||
bs -= 4096;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user