Browse Source

Code cleanup

Tatsuhiro Tsujikawa 14 năm trước cách đây
mục cha
commit
954d595ee8
2 tập tin đã thay đổi với 9 bổ sung5 xóa
  1. 9 0
      src/UTPexExtensionMessage.cc
  2. 0 5
      src/UTPexExtensionMessage.h

+ 9 - 0
src/UTPexExtensionMessage.cc

@@ -46,6 +46,15 @@
 
 namespace aria2 {
 
+namespace {
+
+// This is the hard limit of the number of "fresh peer" and "dropped
+// peer".  This number is treated as the sum of IPv4 and IPv6 peers.
+const size_t DEFAULT_MAX_FRESH_PEER = 50;
+const size_t DEFAULT_MAX_DROPPED_PEER = 50;
+
+} // namespace
+
 const std::string UTPexExtensionMessage::EXTENSION_NAME = "ut_pex";
 
 UTPexExtensionMessage::UTPexExtensionMessage(uint8_t extensionMessageID):

+ 0 - 5
src/UTPexExtensionMessage.h

@@ -65,7 +65,6 @@ private:
 
   size_t maxDroppedPeer_;
 
-
   std::pair<std::pair<std::string, std::string>,
             std::pair<std::string, std::string> >
   createCompactPeerListAndFlag(const std::vector<SharedHandle<Peer> >& peers);
@@ -131,10 +130,6 @@ public:
   }
 
   static const time_t DEFAULT_INTERVAL = 60;
-
-  static const size_t DEFAULT_MAX_FRESH_PEER = 50;
-
-  static const size_t DEFAULT_MAX_DROPPED_PEER = 50;
 };
 
 typedef SharedHandle<UTPexExtensionMessage> UTPexExtensionMessageHandle;