mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-21 05:43:59 -07:00
Some cleanup, and bite the bullet and go ahead and write a simple Http client. Need a cross-platform built-in one to do cli right.
This commit is contained in:
parent
6c29e966dd
commit
53cbe485f0
14 changed files with 470 additions and 726 deletions
|
@ -443,7 +443,7 @@ public:
|
|||
#if defined(_WIN32) || defined(_WIN64)
|
||||
{
|
||||
BOOL f;
|
||||
f = TRUE; ::setsockopt(s,IPPROTO_IPV6,IPV6_V6ONLY,(const char *)&f,sizeof(f));
|
||||
if (remoteAddress->sa_family == AF_INET6) { f = TRUE; ::setsockopt(s,IPPROTO_IPV6,IPV6_V6ONLY,(const char *)&f,sizeof(f)); }
|
||||
f = TRUE; ::setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(const char *)&f,sizeof(f));
|
||||
f = (_noDelay ? TRUE : FALSE); setsockopt(s,IPPROTO_TCP,TCP_NODELAY,(char *)&f,sizeof(f));
|
||||
u_long iMode=1;
|
||||
|
@ -452,7 +452,7 @@ public:
|
|||
#else
|
||||
{
|
||||
int f;
|
||||
f = 1; ::setsockopt(s,IPPROTO_IPV6,IPV6_V6ONLY,(void *)&f,sizeof(f));
|
||||
if (remoteAddress->sa_family == AF_INET6) { f = 1; ::setsockopt(s,IPPROTO_IPV6,IPV6_V6ONLY,(void *)&f,sizeof(f)); }
|
||||
f = 1; ::setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(void *)&f,sizeof(f));
|
||||
f = (_noDelay ? 1 : 0); setsockopt(s,IPPROTO_TCP,TCP_NODELAY,(char *)&f,sizeof(f));
|
||||
fcntl(s,F_SETFL,O_NONBLOCK);
|
||||
|
@ -621,9 +621,9 @@ public:
|
|||
|
||||
case ZT_PHY_SOCKET_TCP_OUT_PENDING:
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
if (FD_ISSET(s->sock,&efds))
|
||||
if (FD_ISSET(s->sock,&efds)) {
|
||||
this->close((PhySocket *)&(*s),true);
|
||||
else // ... if
|
||||
} else // ... if
|
||||
#endif
|
||||
if (FD_ISSET(s->sock,&wfds)) {
|
||||
socklen_t slen = sizeof(ss);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue