|
|
@ -23,7 +23,7 @@ |
|
|
|
#include "HTTP.h" |
|
|
|
#include "HTTP.h" |
|
|
|
#include "util.h" |
|
|
|
#include "util.h" |
|
|
|
|
|
|
|
|
|
|
|
#ifdef __linux__ |
|
|
|
#if defined(__linux__) && !defined(_NETINET_IN_H) |
|
|
|
#include <linux/in6.h> |
|
|
|
#include <linux/in6.h> |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
@ -757,7 +757,7 @@ namespace transport |
|
|
|
if (IsTerminated ()) return; |
|
|
|
if (IsTerminated ()) return; |
|
|
|
#ifdef __linux__ |
|
|
|
#ifdef __linux__ |
|
|
|
const int one = 1; |
|
|
|
const int one = 1; |
|
|
|
setsockopt(m_Socket.native_handle(), IPPROTO_TCP, TCP_QUICKACK, &one, sizeof(one)); |
|
|
|
setsockopt(m_Socket.native_handle(), IPPROTO_TCP, TCP_QUICKACK, &one, sizeof(one)); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
boost::asio::async_read (m_Socket, boost::asio::buffer(&m_NextReceivedLen, 2), boost::asio::transfer_all (), |
|
|
|
boost::asio::async_read (m_Socket, boost::asio::buffer(&m_NextReceivedLen, 2), boost::asio::transfer_all (), |
|
|
|
std::bind(&NTCP2Session::HandleReceivedLength, shared_from_this (), std::placeholders::_1, std::placeholders::_2)); |
|
|
|
std::bind(&NTCP2Session::HandleReceivedLength, shared_from_this (), std::placeholders::_1, std::placeholders::_2)); |
|
|
@ -1243,7 +1243,7 @@ namespace transport |
|
|
|
m_NTCP2V6Acceptor->open (boost::asio::ip::tcp::v6()); |
|
|
|
m_NTCP2V6Acceptor->open (boost::asio::ip::tcp::v6()); |
|
|
|
m_NTCP2V6Acceptor->set_option (boost::asio::ip::v6_only (true)); |
|
|
|
m_NTCP2V6Acceptor->set_option (boost::asio::ip::v6_only (true)); |
|
|
|
m_NTCP2V6Acceptor->set_option (boost::asio::socket_base::reuse_address (true)); |
|
|
|
m_NTCP2V6Acceptor->set_option (boost::asio::socket_base::reuse_address (true)); |
|
|
|
#ifdef __linux__ |
|
|
|
#if defined(__linux__) && !defined(_NETINET_IN_H) |
|
|
|
if (!m_Address6 && !m_YggdrasilAddress) // only if not binded to address
|
|
|
|
if (!m_Address6 && !m_YggdrasilAddress) // only if not binded to address
|
|
|
|
{ |
|
|
|
{ |
|
|
|
// Set preference to use public IPv6 address -- tested on linux, not works on windows, and not tested on others
|
|
|
|
// Set preference to use public IPv6 address -- tested on linux, not works on windows, and not tested on others
|
|
|
|