Fix P2P upload, move P2P config to rahunas.conf.in
authorNeutron Soutmun <neo.neutron@gmail.com>
Wed, 18 Mar 2009 00:18:03 +0000 (07:18 +0700)
committerNeutron Soutmun <neo.neutron@gmail.com>
Wed, 18 Mar 2009 00:18:03 +0000 (07:18 +0700)
2009-03-18  Neutron Soutmun <neo.neutron@gmail.com>

* example/bandwidth.sh.in, example/rahunas.conf.in:
  - Fix P2P upload slot that miss config to use P2P download.
  - Move P2P shaping config from bandwidth.sh.in to rahunas.conf.in.

ChangeLog
example/bandwidth.sh.in
example/rahunas.conf.in

index 3771e28..648d902 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-03-18  Neutron Soutmun <neo.neutron@gmail.com>
+
+       * example/bandwidth.sh.in, example/rahunas.conf.in:
+         - Fix P2P upload slot that miss config to use P2P download.
+         - Move P2P shaping config from bandwidth.sh.in to rahunas.conf.in.
+
 2009-03-17  Neutron Soutmun <neo.neutron@gmail.com>
 
        * example/firewall.sh.in: Fix the allow ip list could not using Bittorrent due    to the wrong rules.
index c76d64d..cd73c9e 100755 (executable)
@@ -15,9 +15,6 @@ RUN=@localstatedir@/run/rahunas-bandwidth
 # Interface Speed (Kbit), Default: 100 Mbps
 INTERFACE_SPEED=102400
 
-DOWN_P2P=512
-UP_P2P=512 
-
 SHAPING_DOWN_INF=imq0
 SHAPING_UP_INF=imq1
 
@@ -39,6 +36,8 @@ get_config_value () {
 
 BANDWIDTH_SHAPE_IMQ=`get_config_value bandwidth_shape_imq`
 BITTORRENT_BLOCK=`get_config_value bittorrent_block`
+DOWN_P2P=`get_config_value bittorrent_download_max`
+UP_P2P=`get_config_value bittorrent_upload_max` 
 
 test "$BANDWIDTH_SHAPE_IMQ" = "yes" || exit 0 
 
@@ -80,7 +79,7 @@ p2p_setting () {
 
       # P2P Upload throttling
       $TC class add dev $SHAPING_UP_INF parent 2:${INTERFACE_ID} \
-        classid 2:${P2P_ID} htb rate ${DOWN_P2P}Kbit
+        classid 2:${P2P_ID} htb rate ${UP_P2P}Kbit
       $TC qdisc add dev $SHAPING_UP_INF parent 2:${P2P_ID} \
         handle ${P2P_ID}: sfq perturb 10
       $TC filter add dev $SHAPING_UP_INF parent 2: protocol ip prio 5 \
index 6e74855..95567de 100644 (file)
@@ -99,3 +99,5 @@ ssh = "yes"
 //// Enable Bittorrent blocking
 bittorrent_block = "no"
 bittorrent_allow = ""
+bittorrent_download_max = "512"
+bittorrent_upload_max = "256"