]> granicus.if.org Git - transmission/commitdiff
Set the read buffer of UTP sockets to a well-defined value.
authorJuliusz Chroboczek <jch@pps.univ-paris-diderot.fr>
Fri, 18 Feb 2011 00:36:05 +0000 (00:36 +0000)
committerJuliusz Chroboczek <jch@pps.univ-paris-diderot.fr>
Fri, 18 Feb 2011 00:36:05 +0000 (00:36 +0000)
libtransmission/peer-io.c

index 763cd76240c9857bf2aa91f8f344615591c49a51..8c3e7e5810ced603f49adc8f3ac005a5e9eb4ba5 100644 (file)
  #define EPIPE        WSAECONNRESET
 #endif
 
+/* The amount of read bufferring that we allow for uTP sockets. */
+
+#define UTP_READ_BUFFER_SIZE (256 * 1024)
+
 static size_t
 guessPacketOverhead( size_t d )
 {
@@ -572,9 +576,11 @@ tr_peerIoNew( tr_session       * session,
     } else {
         tr_ndbg( "UTP", "New %s connection",
                  isIncoming ? "incoming" : "outgoing" );
+        UTP_SetSockopt( utp_socket, SO_RCVBUF, UTP_READ_BUFFER_SIZE );
         UTP_SetCallbacks( utp_socket,
                           &utp_function_table,
                           io );
+        
     }
 
     return io;