瀏覽代碼

Minor DSCP-related improvements

- Improved usage annotation
- Shifted DSCP value to set not whole DS field, but only it's DSCP part
Alexander Amanuel 11 年之前
父節點
當前提交
96a77e42d1
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 2 1
      src/SocketCore.h
  2. 2 1
      src/usage_text.h

+ 2 - 1
src/SocketCore.h

@@ -125,7 +125,8 @@ public:
   void applyIpDscp();
   static void setIpDscp(int ipDscp)
   {
-    ipDscp_ = ipDscp;
+    // Here we prepare DSCP value for IPTOS option, which sets whole DS field
+    ipDscp_ = ipDscp << 2;
   }
 
   void create(int family, int protocol = 0);

+ 2 - 1
src/usage_text.h

@@ -959,4 +959,5 @@
     "                              seconds. If 0 is given, file will be saved only\n" \
     "                              when aria2 exits.")
 #define TEXT_DSCP                                                       \
-  _(" --dscp=DSCP                  Set DSCP code")
+  _(" --dscp=DSCP                  Set DSCP value in outgoing IP packets of\n" \
+    "                              BitTorrent traffic for QoS.")