Browse Source

Move TCP_FASTOPEN to netutils.h

pull/773/head
Max Lv 8 years ago
parent
commit
6f65fedbbd
2 changed files with 22 additions and 21 deletions
  1. 21
      src/common.h
  2. 22
      src/netutils.h

21
src/common.h

@ -22,27 +22,6 @@
#ifndef _COMMON_H #ifndef _COMMON_H
#define _COMMON_H #define _COMMON_H
// only enable TCP_FASTOPEN on linux
#if defined(__linux__)
/* 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
#define DEFAULT_CONF_PATH "/etc/shadowsocks-libev/config.json" #define DEFAULT_CONF_PATH "/etc/shadowsocks-libev/config.json"
#ifndef SOL_TCP #ifndef SOL_TCP

22
src/netutils.h

@ -23,6 +23,28 @@
#ifndef _NETUTILS_H #ifndef _NETUTILS_H
#define _NETUTILS_H #define _NETUTILS_H
// only enable TCP_FASTOPEN on linux
#if defined(__linux__)
/* 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
/* Define the flag MPTCP_ENABLED if not defined*/ /* Define the flag MPTCP_ENABLED if not defined*/
#ifndef MPTCP_ENABLED #ifndef MPTCP_ENABLED
#define MPTCP_ENABLED 26 #define MPTCP_ENABLED 26

Loading…
Cancel
Save