From d634396f986adfca00acb27850403cc4002db2e3 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Wed, 13 Jul 2011 19:22:10 +0000 Subject: [PATCH] (trunk gtk, qt) #4165 "__FD_SETSIZE impact on open-file-limit and peer-limit-global" -- cap the per-torrent and per-session peer limits at FD_SETSIZE. --- gtk/tr-prefs.c | 4 ++-- qt/prefs-dialog.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk/tr-prefs.c b/gtk/tr-prefs.c index e231e956e..adddcdf6a 100644 --- a/gtk/tr-prefs.c +++ b/gtk/tr-prefs.c @@ -1200,9 +1200,9 @@ networkPage( GObject * core ) hig_workarea_add_section_divider( t, &row ); hig_workarea_add_section_title( t, &row, _( "Peer Limits" ) ); - w = new_spin_button( TR_PREFS_KEY_PEER_LIMIT_TORRENT, core, 1, 300, 5 ); + w = new_spin_button( TR_PREFS_KEY_PEER_LIMIT_TORRENT, core, 1, FD_SETSIZE, 5 ); hig_workarea_add_row( t, &row, _( "Maximum peers per _torrent:" ), w, NULL ); - w = new_spin_button( TR_PREFS_KEY_PEER_LIMIT_GLOBAL, core, 1, 3000, 5 ); + w = new_spin_button( TR_PREFS_KEY_PEER_LIMIT_GLOBAL, core, 1, FD_SETSIZE, 5 ); hig_workarea_add_row( t, &row, _( "Maximum peers _overall:" ), w, NULL ); hig_workarea_add_section_divider( t, &row ); diff --git a/qt/prefs-dialog.cc b/qt/prefs-dialog.cc index 5e9e1fc89..64099c8c9 100644 --- a/qt/prefs-dialog.cc +++ b/qt/prefs-dialog.cc @@ -352,8 +352,8 @@ PrefsDialog :: createNetworkTab( ) hig->addSectionDivider( ); hig->addSectionTitle( tr( "Limits" ) ); - hig->addRow( tr( "Maximum peers per &torrent:" ), spinBoxNew( Prefs::PEER_LIMIT_TORRENT, 1, 300, 5 ) ); - hig->addRow( tr( "Maximum peers &overall:" ), spinBoxNew( Prefs::PEER_LIMIT_GLOBAL, 1, 3000, 5 ) ); + hig->addRow( tr( "Maximum peers per &torrent:" ), spinBoxNew( Prefs::PEER_LIMIT_TORRENT, 1, FD_SETSIZE, 5 ) ); + hig->addRow( tr( "Maximum peers &overall:" ), spinBoxNew( Prefs::PEER_LIMIT_GLOBAL, 1, FD_SETSIZE, 5 ) ); hig->addSectionDivider( ); hig->addSectionTitle( tr( "Options" ) );