Refine outbound feature #905

This commit is contained in:
Max Lv
2016-10-29 08:11:53 +08:00
parent a7f5359cab
commit cfae8dcfcc
6 changed files with 89 additions and 131 deletions
+5 -7
View File
@@ -24,32 +24,28 @@
#define _NETUTILS_H
#if defined(__linux__)
#include <linux/tcp.h>
#include <netdb.h>
#elif !defined(__MINGW32__)
#include <netinet/tcp.h>
#else
#include "win32.h"
#endif
// only enable TCP_FASTOPEN on linux
#if defined(__linux__)
#include <linux/tcp.h>
/* conditional define for TCP_FASTOPEN */
#ifndef TCP_FASTOPEN
#define TCP_FASTOPEN 23
#endif
/* conditional define for MSG_FASTOPEN */
#ifndef MSG_FASTOPEN
#define MSG_FASTOPEN 0x20000000
#endif
#elif !defined(__APPLE__)
#ifdef TCP_FASTOPEN
#undef TCP_FASTOPEN
#endif
#endif
/* Backward compatibility for MPTCP_ENABLED between kernel 3 & 4 */
@@ -99,4 +95,6 @@ int sockaddr_cmp_addr(struct sockaddr_storage *addr1,
int validate_hostname(const char *hostname, const int hostname_len);
void print_addrinfo(struct addrinfo *ai);
#endif