mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-11-03 16:45:53 +00:00
Refine outbound feature #905
This commit is contained in:
+5
-7
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user