diff --git a/src/network/network.cc b/src/network/network.cc index df78362..d2c9063 100644 --- a/src/network/network.cc +++ b/src/network/network.cc @@ -198,7 +198,7 @@ Connection::Connection( const char *desired_ip, const char *desired_port ) /* se has_remote_addr( false ), remote_addr(), server( true ), - MTU( SEND_MTU ), + MTU( DEFAULT_SEND_MTU ), key(), session( key ), direction( TO_CLIENT ), @@ -310,7 +310,7 @@ Connection::Connection( const char *key_str, const char *ip, int port ) /* clien has_remote_addr( false ), remote_addr(), server( false ), - MTU( SEND_MTU ), + MTU( DEFAULT_SEND_MTU ), key( key_str ), session( key ), direction( TO_SERVER ), @@ -363,6 +363,10 @@ void Connection::send( string s ) flight anyway. */ have_send_exception = true; send_exception = NetworkException( "sendto", errno ); + + if ( errno == EMSGSIZE ) { + MTU = 500; /* payload MTU of last resort */ + } } uint64_t now = timestamp(); diff --git a/src/network/network.h b/src/network/network.h index f64b93b..f98da24 100644 --- a/src/network/network.h +++ b/src/network/network.h @@ -86,7 +86,7 @@ namespace Network { class Connection { private: - static const int SEND_MTU = 1400; + static const int DEFAULT_SEND_MTU = 1300; static const uint64_t MIN_RTO = 50; /* ms */ static const uint64_t MAX_RTO = 1000; /* ms */