added control over TR forward rate, so that we can experiment with it on large bandwidth servers

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4918 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2012-02-10 22:23:06 +00:00
parent f6c88667c4
commit fd83e5950f
6 changed files with 143 additions and 43 deletions

View file

@ -30,6 +30,7 @@
#include <retroshare/rsiface.h>
#include <retroshare/rspeers.h>
#include <retroshare/rsturtle.h>
#include <QTimer>
@ -42,6 +43,7 @@ ServerPage::ServerPage(QWidget * parent, Qt::WFlags flags)
connect( ui.netModeComboBox, SIGNAL( activated ( int ) ), this, SLOT( toggleUPnP( ) ) );
connect( ui.allowIpDeterminationCB, SIGNAL( toggled( bool ) ), this, SLOT( toggleIpDetermination(bool) ) );
connect( ui.allowTunnelConnectionCB, SIGNAL( toggled( bool ) ), this, SLOT( toggleTunnelConnection(bool) ) );
connect( ui._max_tr_up_per_sec_SB, SIGNAL( valueChanged( int ) ), this, SLOT( updateMaxTRUpRate(int) ) );
QTimer *timer = new QTimer(this);
timer->connect(timer, SIGNAL(timeout()), this, SLOT(updateStatus()));
@ -74,6 +76,11 @@ ServerPage::ServerPage(QWidget * parent, Qt::WFlags flags)
#endif
}
void ServerPage::updateMaxTRUpRate(int b)
{
rsTurtle->setMaxTRForwardRate(b) ;
}
void ServerPage::toggleIpDetermination(bool b)
{
rsPeers->allowServerIPDetermination(b) ;
@ -185,6 +192,8 @@ void ServerPage::load()
ui.dynDNS -> setText(QString::fromStdString(detail.dyndns));
ui.showDiscStatusBar->setChecked(Settings->getStatusBarFlags() & STATUSBAR_DISC);
ui._max_tr_up_per_sec_SB->setValue(rsTurtle->getMaxTRForwardRate()) ;
}
/** Loads the settings for this page */

View file

@ -46,6 +46,7 @@ private slots:
void toggleUPnP();
void toggleIpDetermination(bool) ;
void toggleTunnelConnection(bool) ;
void updateMaxTRUpRate(int) ;
private:
Ui::ServerPage ui;

View file

@ -831,6 +831,75 @@ behind a firewall or a VPN.</string>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Turtle router</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTextBrowser" name="textBrowser">
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Warning&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;&quot;&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt; &lt;/span&gt;This tab contains hard-core parameters which are unlikely to need modification. Dont change them unless you really know what you're doing. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Max average tunnel request forwarded per second:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="_max_tr_up_per_sec_SB">
<property name="toolTip">
<string>This value controls how many tunnel request your peer can forward per second.
If you have a large internet bandwidth, you may raise this up to 30-40, to allow
statisticlly longuer tunnels to pass. Be very careful though, since this generates
many small packets that can significantly slow down your own file transfer.
The default value is 20.</string>
</property>
<property name="minimum">
<number>5</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="value">
<number>20</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>