From 93b3dc5617cd0f8ad251e42209360d4104513fbf Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 16 Nov 2008 21:16:14 +0000 Subject: [PATCH] increase the socket's SNDBUF size --- libtransmission/net.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libtransmission/net.c b/libtransmission/net.c index ce6ca95ba..5bfbe5efa 100644 --- a/libtransmission/net.c +++ b/libtransmission/net.c @@ -119,7 +119,14 @@ makeSocketNonBlocking( int fd ) static int createSocket( int type ) { - return makeSocketNonBlocking( tr_fdSocketCreate( type ) ); + const int fd = makeSocketNonBlocking( tr_fdSocketCreate( type ) ); + + if( fd >= 0 ) { + const int buffsize = 1500*3; /* 3x MTU for most ethernet/wireless */ + setsockopt( fd, SOL_SOCKET, SO_SNDBUF, &buffsize, sizeof( buffsize ) ); + } + + return fd; } int