More conservative default MTU, and react to MSGSIZE

This commit is contained in:
Keith Winstein
2012-10-16 17:46:05 -04:00
parent be3b1259b6
commit 39276a46ad
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -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();