diff --git a/Tribler/Core/APIImplementation/LaunchManyCore.py b/Tribler/Core/APIImplementation/LaunchManyCore.py index 669d8812f5b..ec5ab765634 100644 --- a/Tribler/Core/APIImplementation/LaunchManyCore.py +++ b/Tribler/Core/APIImplementation/LaunchManyCore.py @@ -295,7 +295,7 @@ def load_ipv8_overlays(self): local_peer = Peer(self.session.trustchain_keypair) self.popular_community = PopularCommunity(local_peer, self.ipv8.endpoint, self.ipv8.network, - torrent_db=self.session.lm.torrent_db) + torrent_db=self.session.lm.torrent_db, session=self.session) self.ipv8.overlays.append(self.popular_community) diff --git a/Tribler/Core/Modules/search_manager.py b/Tribler/Core/Modules/search_manager.py index 500c74cff90..9c071bd255d 100644 --- a/Tribler/Core/Modules/search_manager.py +++ b/Tribler/Core/Modules/search_manager.py @@ -55,6 +55,11 @@ def search_for_torrents(self, keywords): self._logger.warn("Could not send search in SearchCommunity, no verified candidates found") break + self._current_keywords = keywords + # If popular community is enabled, send the search request there as well + if self.session.lm.popular_community: + self.session.lm.popular_community.send_torrent_search_request(keywords) + return nr_requests_made @call_on_reactor_thread diff --git a/Tribler/Test/Community/Market/_trial_temp/_trial_marker b/Tribler/Test/Community/Market/_trial_temp/_trial_marker deleted file mode 100755 index e69de29bb2d..00000000000 diff --git a/Tribler/Test/Community/Market/_trial_temp/test.log b/Tribler/Test/Community/Market/_trial_temp/test.log deleted file mode 100644 index eed23a77c9d..00000000000 --- a/Tribler/Test/Community/Market/_trial_temp/test.log +++ /dev/null @@ -1,15 +0,0 @@ -2018-06-08 11:29:52+0200 [-] Log opened. -2018-06-08 11:29:52+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_cancel <-- -2018-06-08 11:29:52+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_counter_trade <-- -2018-06-08 11:29:53+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_create_ask <-- -2018-06-08 11:29:53+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_create_bid <-- -2018-06-08 11:29:53+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_decline_trade <-- -2018-06-08 11:29:53+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_e2e_trade <-- -2018-06-08 11:29:53+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_failing_payment <-- -2018-06-08 11:29:53+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_info_message <-- -2018-06-08 11:29:53+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_orderbook_sync <-- -2018-06-08 11:29:54+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_proposed_trade_timeout <-- -2018-06-08 11:29:54+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunityTwoNodes.test_churn_matchmaker <-- -2018-06-08 11:29:54+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunityTwoNodes.test_e2e_trade <-- -2018-06-08 11:29:55+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunityTwoNodes.test_offline_matchmaker <-- -2018-06-08 11:29:55+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunityTwoNodes.test_partial_trade <-- diff --git a/Tribler/Test/Community/Triblerchain/_trial_temp/_trial_marker b/Tribler/Test/Community/Triblerchain/_trial_temp/_trial_marker deleted file mode 100755 index e69de29bb2d..00000000000 diff --git a/Tribler/Test/Community/Triblerchain/_trial_temp/test.log b/Tribler/Test/Community/Triblerchain/_trial_temp/test.log deleted file mode 100644 index 4c3b17f65f8..00000000000 --- a/Tribler/Test/Community/Triblerchain/_trial_temp/test.log +++ /dev/null @@ -1,3 +0,0 @@ -2018-05-18 12:22:51+0200 [-] Log opened. -2018-05-18 12:22:51+0200 [-] --> Tribler.Test.Community.Triblerchain.test_community.TestTriblerChainCrawlerCommunity.test_crawl_request <-- -2018-05-18 12:22:51+0200 [-] PythonLoggingObserver hooked up diff --git a/Tribler/Test/Community/Tunnel/FullSession/_trial_temp/_trial_marker b/Tribler/Test/Community/Tunnel/FullSession/_trial_temp/_trial_marker deleted file mode 100755 index e69de29bb2d..00000000000 diff --git a/Tribler/Test/Community/Tunnel/FullSession/_trial_temp/test.log b/Tribler/Test/Community/Tunnel/FullSession/_trial_temp/test.log deleted file mode 100644 index 6607d810399..00000000000 --- a/Tribler/Test/Community/Tunnel/FullSession/_trial_temp/test.log +++ /dev/null @@ -1,190 +0,0 @@ -2018-06-04 09:17:00+0200 [-] Log opened. -2018-06-04 09:17:00+0200 [-] PythonLoggingObserver hooked up -2018-06-04 09:17:00+0200 [-] UDPEndpoint starting on 37842 -2018-06-04 09:17:00+0200 [-] Starting protocol -2018-06-04 09:17:00+0200 [-] Factory starting on 2834 -2018-06-04 09:17:00+0200 [-] Starting factory -2018-06-04 09:17:00+0200 [-] Factory starting on 2677 -2018-06-04 09:17:00+0200 [-] Starting factory -2018-06-04 09:17:00+0200 [-] Factory starting on 2824 -2018-06-04 09:17:00+0200 [-] Starting factory -2018-06-04 09:17:00+0200 [-] Factory starting on 1787 -2018-06-04 09:17:00+0200 [-] Starting factory -2018-06-04 09:17:00+0200 [-] Factory starting on 2782 -2018-06-04 09:17:00+0200 [-] Starting factory -2018-06-04 09:17:00+0200 [-] UDPEndpoint starting on 20172 -2018-06-04 09:17:00+0200 [-] Starting protocol -2018-06-04 09:17:00+0200 [-] Factory starting on 2320 -2018-06-04 09:17:00+0200 [-] Starting factory -2018-06-04 09:17:00+0200 [-] Factory starting on 2897 -2018-06-04 09:17:00+0200 [-] Starting factory -2018-06-04 09:17:00+0200 [-] Factory starting on 1836 -2018-06-04 09:17:00+0200 [-] Starting factory -2018-06-04 09:17:00+0200 [-] Factory starting on 2314 -2018-06-04 09:17:00+0200 [-] Starting factory -2018-06-04 09:17:00+0200 [-] Factory starting on 2493 -2018-06-04 09:17:00+0200 [-] Starting factory -2018-06-04 09:17:01+0200 [-] UDPEndpoint starting on 54689 -2018-06-04 09:17:01+0200 [-] Starting protocol -2018-06-04 09:17:01+0200 [-] Factory starting on 1905 -2018-06-04 09:17:01+0200 [-] Starting factory -2018-06-04 09:17:01+0200 [-] Factory starting on 1832 -2018-06-04 09:17:01+0200 [-] Starting factory -2018-06-04 09:17:01+0200 [-] Factory starting on 2015 -2018-06-04 09:17:01+0200 [-] Starting factory -2018-06-04 09:17:01+0200 [-] Factory starting on 2998 -2018-06-04 09:17:01+0200 [-] Starting factory -2018-06-04 09:17:01+0200 [-] Factory starting on 2714 -2018-06-04 09:17:01+0200 [-] Starting factory -2018-06-04 09:17:01+0200 [-] UDPEndpoint starting on 42088 -2018-06-04 09:17:01+0200 [-] Starting protocol -2018-06-04 09:17:06+0200 [Socks5Connection,0,127.0.0.1] SocksUDPConnection starting on 35195 -2018-06-04 09:17:06+0200 [Socks5Connection,0,127.0.0.1] Starting protocol -2018-06-04 09:17:06+0200 [-] TunnelExitSocket starting on 51701 -2018-06-04 09:17:06+0200 [-] Starting protocol -2018-06-04 09:17:13+0200 [-] (UDP Port 42088 Closed) -2018-06-04 09:17:13+0200 [-] Stopping protocol -2018-06-04 09:17:15+0200 [-] (TCP Port 2320 Closed) -2018-06-04 09:17:15+0200 [-] Stopping factory -2018-06-04 09:17:15+0200 [-] (TCP Port 2897 Closed) -2018-06-04 09:17:15+0200 [-] Stopping factory -2018-06-04 09:17:15+0200 [-] (TCP Port 1836 Closed) -2018-06-04 09:17:15+0200 [-] Stopping factory -2018-06-04 09:17:15+0200 [-] (TCP Port 2314 Closed) -2018-06-04 09:17:15+0200 [-] Stopping factory -2018-06-04 09:17:15+0200 [-] (TCP Port 2493 Closed) -2018-06-04 09:17:15+0200 [-] Stopping factory -2018-06-04 09:17:15+0200 [-] (UDP Port 20172 Closed) -2018-06-04 09:17:15+0200 [-] Stopping protocol -2018-06-04 09:17:15+0200 [-] (TCP Port 1905 Closed) -2018-06-04 09:17:15+0200 [-] Stopping factory -2018-06-04 09:17:15+0200 [-] (TCP Port 1832 Closed) -2018-06-04 09:17:15+0200 [-] Stopping factory -2018-06-04 09:17:15+0200 [-] (TCP Port 2015 Closed) -2018-06-04 09:17:15+0200 [-] Stopping factory -2018-06-04 09:17:15+0200 [-] (TCP Port 2998 Closed) -2018-06-04 09:17:15+0200 [-] Stopping factory -2018-06-04 09:17:15+0200 [-] (TCP Port 2714 Closed) -2018-06-04 09:17:15+0200 [-] Stopping factory -2018-06-04 09:17:15+0200 [-] (UDP Port 51701 Closed) -2018-06-04 09:17:15+0200 [-] Stopping protocol -2018-06-04 09:17:15+0200 [-] (UDP Port 54689 Closed) -2018-06-04 09:17:15+0200 [-] Stopping protocol -2018-06-04 09:17:16+0200 [-] (UDP Port 35195 Closed) -2018-06-04 09:17:16+0200 [-] Stopping protocol -2018-06-04 09:17:16+0200 [-] (TCP Port 2834 Closed) -2018-06-04 09:17:16+0200 [-] Stopping factory -2018-06-04 09:17:16+0200 [-] (TCP Port 2677 Closed) -2018-06-04 09:17:16+0200 [-] Stopping factory -2018-06-04 09:17:16+0200 [-] (TCP Port 2824 Closed) -2018-06-04 09:17:16+0200 [-] Stopping factory -2018-06-04 09:17:16+0200 [-] (TCP Port 1787 Closed) -2018-06-04 09:17:16+0200 [-] Stopping factory -2018-06-04 09:17:16+0200 [-] (TCP Port 2782 Closed) -2018-06-04 09:17:16+0200 [-] Stopping factory -2018-06-04 09:17:16+0200 [-] (UDP Port 37842 Closed) -2018-06-04 09:17:16+0200 [-] Stopping protocol -2018-06-04 09:17:18+0200 [-] UDPEndpoint starting on 59425 -2018-06-04 09:17:18+0200 [-] Starting protocol -2018-06-04 09:17:18+0200 [-] Factory starting on 2636 -2018-06-04 09:17:18+0200 [-] Starting factory -2018-06-04 09:17:18+0200 [-] Factory starting on 1178 -2018-06-04 09:17:18+0200 [-] Starting factory -2018-06-04 09:17:18+0200 [-] Factory starting on 1896 -2018-06-04 09:17:18+0200 [-] Starting factory -2018-06-04 09:17:18+0200 [-] Factory starting on 2938 -2018-06-04 09:17:18+0200 [-] Starting factory -2018-06-04 09:17:18+0200 [-] Factory starting on 2991 -2018-06-04 09:17:18+0200 [-] Starting factory -2018-06-04 09:17:18+0200 [-] UDPEndpoint starting on 31129 -2018-06-04 09:17:18+0200 [-] Starting protocol -2018-06-04 09:17:18+0200 [-] Factory starting on 2599 -2018-06-04 09:17:18+0200 [-] Starting factory -2018-06-04 09:17:18+0200 [-] Factory starting on 1833 -2018-06-04 09:17:18+0200 [-] Starting factory -2018-06-04 09:17:18+0200 [-] Factory starting on 1428 -2018-06-04 09:17:18+0200 [-] Starting factory -2018-06-04 09:17:18+0200 [-] Factory starting on 2263 -2018-06-04 09:17:18+0200 [-] Starting factory -2018-06-04 09:17:18+0200 [-] Factory starting on 2212 -2018-06-04 09:17:18+0200 [-] Starting factory -2018-06-04 09:17:19+0200 [-] UDPEndpoint starting on 5931 -2018-06-04 09:17:19+0200 [-] Starting protocol -2018-06-04 09:17:49+0200 [-] (UDP Port 5931 Closed) -2018-06-04 09:17:49+0200 [-] Stopping protocol -2018-06-04 09:17:50+0200 [-] (TCP Port 2599 Closed) -2018-06-04 09:17:50+0200 [-] Stopping factory -2018-06-04 09:17:50+0200 [-] (TCP Port 1833 Closed) -2018-06-04 09:17:50+0200 [-] Stopping factory -2018-06-04 09:17:50+0200 [-] (TCP Port 1428 Closed) -2018-06-04 09:17:50+0200 [-] Stopping factory -2018-06-04 09:17:50+0200 [-] (TCP Port 2263 Closed) -2018-06-04 09:17:50+0200 [-] Stopping factory -2018-06-04 09:17:50+0200 [-] (TCP Port 2212 Closed) -2018-06-04 09:17:50+0200 [-] Stopping factory -2018-06-04 09:17:50+0200 [-] (UDP Port 31129 Closed) -2018-06-04 09:17:50+0200 [-] Stopping protocol -2018-06-04 09:17:51+0200 [-] (TCP Port 2636 Closed) -2018-06-04 09:17:51+0200 [-] Stopping factory -2018-06-04 09:17:51+0200 [-] (TCP Port 1178 Closed) -2018-06-04 09:17:51+0200 [-] Stopping factory -2018-06-04 09:17:51+0200 [-] (TCP Port 1896 Closed) -2018-06-04 09:17:51+0200 [-] Stopping factory -2018-06-04 09:17:51+0200 [-] (TCP Port 2938 Closed) -2018-06-04 09:17:51+0200 [-] Stopping factory -2018-06-04 09:17:51+0200 [-] (TCP Port 2991 Closed) -2018-06-04 09:17:51+0200 [-] Stopping factory -2018-06-04 09:17:51+0200 [-] (UDP Port 59425 Closed) -2018-06-04 09:17:51+0200 [-] Stopping protocol -2018-06-04 09:17:52+0200 [-] UDPEndpoint starting on 35928 -2018-06-04 09:17:52+0200 [-] Starting protocol -2018-06-04 09:17:52+0200 [-] Factory starting on 1141 -2018-06-04 09:17:52+0200 [-] Starting factory -2018-06-04 09:17:52+0200 [-] Factory starting on 1179 -2018-06-04 09:17:52+0200 [-] Starting factory -2018-06-04 09:17:52+0200 [-] Factory starting on 2733 -2018-06-04 09:17:52+0200 [-] Starting factory -2018-06-04 09:17:52+0200 [-] Factory starting on 1645 -2018-06-04 09:17:52+0200 [-] Starting factory -2018-06-04 09:17:52+0200 [-] Factory starting on 1869 -2018-06-04 09:17:52+0200 [-] Starting factory -2018-06-04 09:17:52+0200 [-] UDPEndpoint starting on 50019 -2018-06-04 09:17:52+0200 [-] Starting protocol -2018-06-04 09:17:52+0200 [-] Factory starting on 2723 -2018-06-04 09:17:52+0200 [-] Starting factory -2018-06-04 09:17:52+0200 [-] Factory starting on 2283 -2018-06-04 09:17:52+0200 [-] Starting factory -2018-06-04 09:17:52+0200 [-] Factory starting on 1437 -2018-06-04 09:17:52+0200 [-] Starting factory -2018-06-04 09:17:52+0200 [-] Factory starting on 2483 -2018-06-04 09:17:52+0200 [-] Starting factory -2018-06-04 09:17:52+0200 [-] Factory starting on 1766 -2018-06-04 09:17:52+0200 [-] Starting factory -2018-06-04 09:17:53+0200 [-] UDPEndpoint starting on 54492 -2018-06-04 09:17:53+0200 [-] Starting protocol -2018-06-04 09:18:23+0200 [-] (UDP Port 54492 Closed) -2018-06-04 09:18:23+0200 [-] Stopping protocol -2018-06-04 09:18:24+0200 [-] (TCP Port 2723 Closed) -2018-06-04 09:18:24+0200 [-] Stopping factory -2018-06-04 09:18:24+0200 [-] (TCP Port 2283 Closed) -2018-06-04 09:18:24+0200 [-] Stopping factory -2018-06-04 09:18:24+0200 [-] (TCP Port 1437 Closed) -2018-06-04 09:18:24+0200 [-] Stopping factory -2018-06-04 09:18:24+0200 [-] (TCP Port 2483 Closed) -2018-06-04 09:18:24+0200 [-] Stopping factory -2018-06-04 09:18:24+0200 [-] (TCP Port 1766 Closed) -2018-06-04 09:18:24+0200 [-] Stopping factory -2018-06-04 09:18:24+0200 [-] (UDP Port 50019 Closed) -2018-06-04 09:18:24+0200 [-] Stopping protocol -2018-06-04 09:18:25+0200 [-] (TCP Port 1141 Closed) -2018-06-04 09:18:25+0200 [-] Stopping factory -2018-06-04 09:18:25+0200 [-] (TCP Port 1179 Closed) -2018-06-04 09:18:25+0200 [-] Stopping factory -2018-06-04 09:18:25+0200 [-] (TCP Port 2733 Closed) -2018-06-04 09:18:25+0200 [-] Stopping factory -2018-06-04 09:18:25+0200 [-] (TCP Port 1645 Closed) -2018-06-04 09:18:25+0200 [-] Stopping factory -2018-06-04 09:18:25+0200 [-] (TCP Port 1869 Closed) -2018-06-04 09:18:25+0200 [-] Stopping factory -2018-06-04 09:18:25+0200 [-] (UDP Port 35928 Closed) -2018-06-04 09:18:25+0200 [-] Stopping protocol diff --git a/Tribler/Test/Community/_trial_temp/_trial_marker b/Tribler/Test/Community/_trial_temp/_trial_marker deleted file mode 100755 index e69de29bb2d..00000000000 diff --git a/Tribler/Test/Community/_trial_temp/test.log b/Tribler/Test/Community/_trial_temp/test.log deleted file mode 100644 index 1e112aff560..00000000000 --- a/Tribler/Test/Community/_trial_temp/test.log +++ /dev/null @@ -1,456 +0,0 @@ -2018-05-08 14:10:33+0200 [-] Log opened. -2018-05-08 14:10:38+0200 [-] --> Tribler.Test.Community.Market.Wallet.test_trustchain_wallet.TestTrustchainWallet.test_address <-- -2018-05-08 14:10:38+0200 [-] --> Tribler.Test.Community.Market.Wallet.test_trustchain_wallet.TestTrustchainWallet.test_create_wallet <-- -2018-05-08 14:10:38+0200 [-] --> Tribler.Test.Community.Market.Wallet.test_trustchain_wallet.TestTrustchainWallet.test_get_balance <-- -2018-05-08 14:10:38+0200 [-] --> Tribler.Test.Community.Market.Wallet.test_trustchain_wallet.TestTrustchainWallet.test_get_mc_wallet_id <-- -2018-05-08 14:10:38+0200 [-] --> Tribler.Test.Community.Market.Wallet.test_trustchain_wallet.TestTrustchainWallet.test_get_mc_wallet_name <-- -2018-05-08 14:10:38+0200 [-] --> Tribler.Test.Community.Market.Wallet.test_trustchain_wallet.TestTrustchainWallet.test_get_transaction <-- -2018-05-08 14:10:38+0200 [-] --> Tribler.Test.Community.Market.Wallet.test_trustchain_wallet.TestTrustchainWallet.test_min_unit <-- -2018-05-08 14:10:38+0200 [-] --> Tribler.Test.Community.Market.Wallet.test_trustchain_wallet.TestTrustchainWallet.test_monitor_transaction <-- -2018-05-08 14:10:38+0200 [-] --> Tribler.Test.Community.Market.Wallet.test_trustchain_wallet.TestTrustchainWallet.test_transfer_invalid <-- -2018-05-08 14:10:38+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_cancel <-- -2018-05-08 14:10:38+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_counter_trade <-- -2018-05-08 14:10:39+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_create_ask <-- -2018-05-08 14:10:39+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_create_bid <-- -2018-05-08 14:10:39+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_decline_trade <-- -2018-05-08 14:10:39+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_e2e_trade <-- -2018-05-08 14:10:39+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_failing_payment <-- -2018-05-08 14:10:39+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_info_message <-- -2018-05-08 14:10:39+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_orderbook_sync <-- -2018-05-08 14:10:40+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunity.test_proposed_trade_timeout <-- -2018-05-08 14:10:40+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunityTwoNodes.test_churn_matchmaker <-- -2018-05-08 14:10:40+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunityTwoNodes.test_e2e_trade <-- -2018-05-08 14:10:40+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunityTwoNodes.test_offline_matchmaker <-- -2018-05-08 14:10:41+0200 [-] --> Tribler.Test.Community.Market.test_community.TestMarketCommunityTwoNodes.test_partial_trade <-- -2018-05-08 14:10:58+0200 [-] UdpSocketManager starting on 44298 -2018-05-08 14:10:58+0200 [-] Starting protocol -2018-05-08 14:10:58+0200 [-] UdpSocketManager starting on 51205 -2018-05-08 14:10:58+0200 [-] Starting protocol -2018-05-08 14:11:03+0200 [-] (UDP Port 51205 Closed) -2018-05-08 14:11:03+0200 [-] Stopping protocol -2018-05-08 14:11:04+0200 [-] (UDP Port 44298 Closed) -2018-05-08 14:11:04+0200 [-] Stopping protocol -2018-05-08 14:11:05+0200 [-] UdpSocketManager starting on 32826 -2018-05-08 14:11:05+0200 [-] Starting protocol -2018-05-08 14:11:05+0200 [-] UdpSocketManager starting on 51761 -2018-05-08 14:11:05+0200 [-] Starting protocol -2018-05-08 14:11:07+0200 [-] (UDP Port 51761 Closed) -2018-05-08 14:11:07+0200 [-] Stopping protocol -2018-05-08 14:11:08+0200 [-] (UDP Port 32826 Closed) -2018-05-08 14:11:08+0200 [-] Stopping protocol -2018-05-08 14:11:12+0200 [-] --> Tribler.Test.Community.Triblerchain.test_community.TestTriblerChainCrawlerCommunity.test_crawl_request <-- -2018-05-08 14:11:12+0200 [-] UDPEndpoint starting on 47164 -2018-05-08 14:11:12+0200 [-] Starting protocol -2018-05-08 14:11:12+0200 [-] Factory starting on 1799 -2018-05-08 14:11:12+0200 [-] Starting factory -2018-05-08 14:11:12+0200 [-] Factory starting on 2236 -2018-05-08 14:11:12+0200 [-] Starting factory -2018-05-08 14:11:12+0200 [-] Factory starting on 2635 -2018-05-08 14:11:12+0200 [-] Starting factory -2018-05-08 14:11:12+0200 [-] Factory starting on 2719 -2018-05-08 14:11:12+0200 [-] Starting factory -2018-05-08 14:11:12+0200 [-] Factory starting on 1030 -2018-05-08 14:11:12+0200 [-] Starting factory -2018-05-08 14:11:12+0200 [-] UDPEndpoint starting on 58949 -2018-05-08 14:11:12+0200 [-] Starting protocol -2018-05-08 14:11:12+0200 [-] Factory starting on 2486 -2018-05-08 14:11:12+0200 [-] Starting factory -2018-05-08 14:11:12+0200 [-] Factory starting on 1260 -2018-05-08 14:11:12+0200 [-] Starting factory -2018-05-08 14:11:12+0200 [-] Factory starting on 2428 -2018-05-08 14:11:12+0200 [-] Starting factory -2018-05-08 14:11:12+0200 [-] Factory starting on 2411 -2018-05-08 14:11:12+0200 [-] Starting factory -2018-05-08 14:11:12+0200 [-] Factory starting on 2219 -2018-05-08 14:11:12+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] UDPEndpoint starting on 10863 -2018-05-08 14:11:13+0200 [-] Starting protocol -2018-05-08 14:11:13+0200 [-] Factory starting on 1696 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] Factory starting on 1311 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] Factory starting on 2451 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] Factory starting on 2306 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] Factory starting on 2082 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] UDPEndpoint starting on 50222 -2018-05-08 14:11:13+0200 [-] Starting protocol -2018-05-08 14:11:13+0200 [-] Factory starting on 1703 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] Factory starting on 1833 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] Factory starting on 1499 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] Factory starting on 1990 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] Factory starting on 1812 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] UDPEndpoint starting on 7475 -2018-05-08 14:11:13+0200 [-] Starting protocol -2018-05-08 14:11:13+0200 [-] Factory starting on 1946 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] Factory starting on 2936 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] Factory starting on 2198 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] Factory starting on 2023 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] Factory starting on 2067 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] UDPEndpoint starting on 51909 -2018-05-08 14:11:13+0200 [-] Starting protocol -2018-05-08 14:11:13+0200 [-] Factory starting on 1364 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] Factory starting on 2795 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] Factory starting on 2747 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] Factory starting on 2458 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:13+0200 [-] Factory starting on 1750 -2018-05-08 14:11:13+0200 [-] Starting factory -2018-05-08 14:11:14+0200 [-] UDPEndpoint starting on 38912 -2018-05-08 14:11:14+0200 [-] Starting protocol -2018-05-08 14:11:14+0200 [-] Factory starting on 1390 -2018-05-08 14:11:14+0200 [-] Starting factory -2018-05-08 14:11:14+0200 [-] Factory starting on 1794 -2018-05-08 14:11:14+0200 [-] Starting factory -2018-05-08 14:11:14+0200 [-] Factory starting on 1370 -2018-05-08 14:11:14+0200 [-] Starting factory -2018-05-08 14:11:14+0200 [-] Factory starting on 2971 -2018-05-08 14:11:14+0200 [-] Starting factory -2018-05-08 14:11:14+0200 [-] Factory starting on 2301 -2018-05-08 14:11:14+0200 [-] Starting factory -2018-05-08 14:11:14+0200 [-] UDPEndpoint starting on 14133 -2018-05-08 14:11:14+0200 [-] Starting protocol -2018-05-08 14:11:14+0200 [-] Factory starting on 2806 -2018-05-08 14:11:14+0200 [-] Starting factory -2018-05-08 14:11:14+0200 [-] Factory starting on 1939 -2018-05-08 14:11:14+0200 [-] Starting factory -2018-05-08 14:11:14+0200 [-] Factory starting on 1235 -2018-05-08 14:11:14+0200 [-] Starting factory -2018-05-08 14:11:14+0200 [-] Factory starting on 1132 -2018-05-08 14:11:14+0200 [-] Starting factory -2018-05-08 14:11:14+0200 [-] Factory starting on 2077 -2018-05-08 14:11:14+0200 [-] Starting factory -2018-05-08 14:11:19+0200 [Socks5Connection,0,127.0.0.1] SocksUDPConnection starting on 34103 -2018-05-08 14:11:19+0200 [Socks5Connection,0,127.0.0.1] Starting protocol -2018-05-08 14:11:19+0200 [-] TunnelExitSocket starting on 33327 -2018-05-08 14:11:19+0200 [-] Starting protocol -2018-05-08 14:11:21+0200 [Socks5Connection,0,127.0.0.1] SocksUDPConnection starting on 36674 -2018-05-08 14:11:21+0200 [Socks5Connection,0,127.0.0.1] Starting protocol -2018-05-08 14:11:21+0200 [-] TunnelExitSocket starting on 50804 -2018-05-08 14:11:21+0200 [-] Starting protocol -2018-05-08 14:11:23+0200 [-] TunnelExitSocket starting on 60967 -2018-05-08 14:11:23+0200 [-] Starting protocol -2018-05-08 14:11:27+0200 [-] (UDP Port 34103 Closed) -2018-05-08 14:11:27+0200 [-] Stopping protocol -2018-05-08 14:11:27+0200 [-] (TCP Port 2806 Closed) -2018-05-08 14:11:27+0200 [-] Stopping factory -2018-05-08 14:11:27+0200 [-] (TCP Port 1939 Closed) -2018-05-08 14:11:27+0200 [-] Stopping factory -2018-05-08 14:11:27+0200 [-] (TCP Port 1235 Closed) -2018-05-08 14:11:27+0200 [-] Stopping factory -2018-05-08 14:11:27+0200 [-] (TCP Port 1132 Closed) -2018-05-08 14:11:27+0200 [-] Stopping factory -2018-05-08 14:11:27+0200 [-] (TCP Port 2077 Closed) -2018-05-08 14:11:27+0200 [-] Stopping factory -2018-05-08 14:11:27+0200 [-] (UDP Port 14133 Closed) -2018-05-08 14:11:27+0200 [-] Stopping protocol -2018-05-08 14:11:27+0200 [-] (UDP Port 33327 Closed) -2018-05-08 14:11:27+0200 [-] Stopping protocol -2018-05-08 14:11:27+0200 [-] (UDP Port 60967 Closed) -2018-05-08 14:11:27+0200 [-] Stopping protocol -2018-05-08 14:11:29+0200 [-] (TCP Port 2486 Closed) -2018-05-08 14:11:29+0200 [-] Stopping factory -2018-05-08 14:11:29+0200 [-] (TCP Port 1260 Closed) -2018-05-08 14:11:29+0200 [-] Stopping factory -2018-05-08 14:11:29+0200 [-] (TCP Port 2428 Closed) -2018-05-08 14:11:29+0200 [-] Stopping factory -2018-05-08 14:11:29+0200 [-] (TCP Port 2411 Closed) -2018-05-08 14:11:29+0200 [-] Stopping factory -2018-05-08 14:11:29+0200 [-] (TCP Port 2219 Closed) -2018-05-08 14:11:29+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (UDP Port 58949 Closed) -2018-05-08 14:11:30+0200 [-] Stopping protocol -2018-05-08 14:11:30+0200 [-] (TCP Port 1696 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (TCP Port 1311 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (TCP Port 2451 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (TCP Port 2306 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (TCP Port 2082 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (UDP Port 10863 Closed) -2018-05-08 14:11:30+0200 [-] Stopping protocol -2018-05-08 14:11:30+0200 [-] (TCP Port 1703 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (TCP Port 1833 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (TCP Port 1499 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (TCP Port 1990 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (TCP Port 1812 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (UDP Port 50222 Closed) -2018-05-08 14:11:30+0200 [-] Stopping protocol -2018-05-08 14:11:30+0200 [-] (TCP Port 1946 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (TCP Port 2936 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (TCP Port 2198 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (TCP Port 2023 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (TCP Port 2067 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (UDP Port 7475 Closed) -2018-05-08 14:11:30+0200 [-] Stopping protocol -2018-05-08 14:11:30+0200 [-] (TCP Port 1364 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (TCP Port 2795 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (TCP Port 2747 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (TCP Port 2458 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:30+0200 [-] (TCP Port 1750 Closed) -2018-05-08 14:11:30+0200 [-] Stopping factory -2018-05-08 14:11:31+0200 [-] (UDP Port 51909 Closed) -2018-05-08 14:11:31+0200 [-] Stopping protocol -2018-05-08 14:11:31+0200 [-] (TCP Port 1390 Closed) -2018-05-08 14:11:31+0200 [-] Stopping factory -2018-05-08 14:11:31+0200 [-] (TCP Port 1794 Closed) -2018-05-08 14:11:31+0200 [-] Stopping factory -2018-05-08 14:11:31+0200 [-] (TCP Port 1370 Closed) -2018-05-08 14:11:31+0200 [-] Stopping factory -2018-05-08 14:11:31+0200 [-] (TCP Port 2971 Closed) -2018-05-08 14:11:31+0200 [-] Stopping factory -2018-05-08 14:11:31+0200 [-] (TCP Port 2301 Closed) -2018-05-08 14:11:31+0200 [-] Stopping factory -2018-05-08 14:11:31+0200 [-] (UDP Port 50804 Closed) -2018-05-08 14:11:31+0200 [-] Stopping protocol -2018-05-08 14:11:31+0200 [-] (UDP Port 38912 Closed) -2018-05-08 14:11:31+0200 [-] Stopping protocol -2018-05-08 14:11:31+0200 [-] (UDP Port 36674 Closed) -2018-05-08 14:11:31+0200 [-] Stopping protocol -2018-05-08 14:11:31+0200 [-] (TCP Port 1799 Closed) -2018-05-08 14:11:31+0200 [-] Stopping factory -2018-05-08 14:11:31+0200 [-] (TCP Port 2236 Closed) -2018-05-08 14:11:31+0200 [-] Stopping factory -2018-05-08 14:11:31+0200 [-] (TCP Port 2635 Closed) -2018-05-08 14:11:31+0200 [-] Stopping factory -2018-05-08 14:11:31+0200 [-] (TCP Port 2719 Closed) -2018-05-08 14:11:31+0200 [-] Stopping factory -2018-05-08 14:11:31+0200 [-] (TCP Port 1030 Closed) -2018-05-08 14:11:31+0200 [-] Stopping factory -2018-05-08 14:11:31+0200 [-] (UDP Port 47164 Closed) -2018-05-08 14:11:31+0200 [-] Stopping protocol -2018-05-08 14:11:32+0200 [-] UDPEndpoint starting on 24797 -2018-05-08 14:11:32+0200 [-] Starting protocol -2018-05-08 14:11:32+0200 [-] Factory starting on 1863 -2018-05-08 14:11:32+0200 [-] Starting factory -2018-05-08 14:11:32+0200 [-] Factory starting on 1101 -2018-05-08 14:11:32+0200 [-] Starting factory -2018-05-08 14:11:32+0200 [-] Factory starting on 2359 -2018-05-08 14:11:32+0200 [-] Starting factory -2018-05-08 14:11:32+0200 [-] Factory starting on 1659 -2018-05-08 14:11:32+0200 [-] Starting factory -2018-05-08 14:11:32+0200 [-] Factory starting on 1486 -2018-05-08 14:11:32+0200 [-] Starting factory -2018-05-08 14:11:33+0200 [-] UDPEndpoint starting on 50659 -2018-05-08 14:11:33+0200 [-] Starting protocol -2018-05-08 14:11:33+0200 [-] Factory starting on 1267 -2018-05-08 14:11:33+0200 [-] Starting factory -2018-05-08 14:11:33+0200 [-] Factory starting on 1611 -2018-05-08 14:11:33+0200 [-] Starting factory -2018-05-08 14:11:33+0200 [-] Factory starting on 2191 -2018-05-08 14:11:33+0200 [-] Starting factory -2018-05-08 14:11:33+0200 [-] Factory starting on 2968 -2018-05-08 14:11:33+0200 [-] Starting factory -2018-05-08 14:11:33+0200 [-] Factory starting on 1079 -2018-05-08 14:11:33+0200 [-] Starting factory -2018-05-08 14:11:33+0200 [-] UDPEndpoint starting on 14265 -2018-05-08 14:11:33+0200 [-] Starting protocol -2018-05-08 14:11:33+0200 [-] Factory starting on 2705 -2018-05-08 14:11:33+0200 [-] Starting factory -2018-05-08 14:11:33+0200 [-] Factory starting on 1348 -2018-05-08 14:11:33+0200 [-] Starting factory -2018-05-08 14:11:33+0200 [-] Factory starting on 2938 -2018-05-08 14:11:33+0200 [-] Starting factory -2018-05-08 14:11:33+0200 [-] Factory starting on 2440 -2018-05-08 14:11:33+0200 [-] Starting factory -2018-05-08 14:11:33+0200 [-] Factory starting on 1394 -2018-05-08 14:11:33+0200 [-] Starting factory -2018-05-08 14:11:33+0200 [-] UDPEndpoint starting on 59411 -2018-05-08 14:11:33+0200 [-] Starting protocol -2018-05-08 14:11:38+0200 [Socks5Connection,0,127.0.0.1] SocksUDPConnection starting on 49452 -2018-05-08 14:11:38+0200 [Socks5Connection,0,127.0.0.1] Starting protocol -2018-05-08 14:11:38+0200 [-] TunnelExitSocket starting on 58723 -2018-05-08 14:11:38+0200 [-] Starting protocol -2018-05-08 14:11:43+0200 [-] (UDP Port 59411 Closed) -2018-05-08 14:11:43+0200 [-] Stopping protocol -2018-05-08 14:11:45+0200 [-] (TCP Port 1267 Closed) -2018-05-08 14:11:45+0200 [-] Stopping factory -2018-05-08 14:11:45+0200 [-] (TCP Port 1611 Closed) -2018-05-08 14:11:45+0200 [-] Stopping factory -2018-05-08 14:11:45+0200 [-] (TCP Port 2191 Closed) -2018-05-08 14:11:45+0200 [-] Stopping factory -2018-05-08 14:11:45+0200 [-] (TCP Port 2968 Closed) -2018-05-08 14:11:45+0200 [-] Stopping factory -2018-05-08 14:11:45+0200 [-] (TCP Port 1079 Closed) -2018-05-08 14:11:45+0200 [-] Stopping factory -2018-05-08 14:11:46+0200 [-] (UDP Port 50659 Closed) -2018-05-08 14:11:46+0200 [-] Stopping protocol -2018-05-08 14:11:46+0200 [-] (TCP Port 2705 Closed) -2018-05-08 14:11:46+0200 [-] Stopping factory -2018-05-08 14:11:46+0200 [-] (TCP Port 1348 Closed) -2018-05-08 14:11:46+0200 [-] Stopping factory -2018-05-08 14:11:46+0200 [-] (TCP Port 2938 Closed) -2018-05-08 14:11:46+0200 [-] Stopping factory -2018-05-08 14:11:46+0200 [-] (TCP Port 2440 Closed) -2018-05-08 14:11:46+0200 [-] Stopping factory -2018-05-08 14:11:46+0200 [-] (TCP Port 1394 Closed) -2018-05-08 14:11:46+0200 [-] Stopping factory -2018-05-08 14:11:46+0200 [-] (UDP Port 58723 Closed) -2018-05-08 14:11:46+0200 [-] Stopping protocol -2018-05-08 14:11:46+0200 [-] (UDP Port 14265 Closed) -2018-05-08 14:11:46+0200 [-] Stopping protocol -2018-05-08 14:11:46+0200 [-] (UDP Port 49452 Closed) -2018-05-08 14:11:46+0200 [-] Stopping protocol -2018-05-08 14:11:46+0200 [-] (TCP Port 1863 Closed) -2018-05-08 14:11:46+0200 [-] Stopping factory -2018-05-08 14:11:46+0200 [-] (TCP Port 1101 Closed) -2018-05-08 14:11:46+0200 [-] Stopping factory -2018-05-08 14:11:46+0200 [-] (TCP Port 2359 Closed) -2018-05-08 14:11:46+0200 [-] Stopping factory -2018-05-08 14:11:46+0200 [-] (TCP Port 1659 Closed) -2018-05-08 14:11:46+0200 [-] Stopping factory -2018-05-08 14:11:46+0200 [-] (TCP Port 1486 Closed) -2018-05-08 14:11:46+0200 [-] Stopping factory -2018-05-08 14:11:46+0200 [-] (UDP Port 24797 Closed) -2018-05-08 14:11:46+0200 [-] Stopping protocol -2018-05-08 14:11:48+0200 [-] UDPEndpoint starting on 59200 -2018-05-08 14:11:48+0200 [-] Starting protocol -2018-05-08 14:11:48+0200 [-] Factory starting on 1662 -2018-05-08 14:11:48+0200 [-] Starting factory -2018-05-08 14:11:48+0200 [-] Factory starting on 2449 -2018-05-08 14:11:48+0200 [-] Starting factory -2018-05-08 14:11:48+0200 [-] Factory starting on 2592 -2018-05-08 14:11:48+0200 [-] Starting factory -2018-05-08 14:11:48+0200 [-] Factory starting on 1787 -2018-05-08 14:11:48+0200 [-] Starting factory -2018-05-08 14:11:48+0200 [-] Factory starting on 1165 -2018-05-08 14:11:48+0200 [-] Starting factory -2018-05-08 14:11:48+0200 [-] UDPEndpoint starting on 43893 -2018-05-08 14:11:48+0200 [-] Starting protocol -2018-05-08 14:11:48+0200 [-] Factory starting on 2377 -2018-05-08 14:11:48+0200 [-] Starting factory -2018-05-08 14:11:48+0200 [-] Factory starting on 2103 -2018-05-08 14:11:48+0200 [-] Starting factory -2018-05-08 14:11:48+0200 [-] Factory starting on 2076 -2018-05-08 14:11:48+0200 [-] Starting factory -2018-05-08 14:11:48+0200 [-] Factory starting on 1992 -2018-05-08 14:11:48+0200 [-] Starting factory -2018-05-08 14:11:48+0200 [-] Factory starting on 1879 -2018-05-08 14:11:48+0200 [-] Starting factory -2018-05-08 14:11:48+0200 [-] UDPEndpoint starting on 49692 -2018-05-08 14:11:48+0200 [-] Starting protocol -2018-05-08 14:12:18+0200 [-] (UDP Port 49692 Closed) -2018-05-08 14:12:18+0200 [-] Stopping protocol -2018-05-08 14:12:20+0200 [-] (TCP Port 2377 Closed) -2018-05-08 14:12:20+0200 [-] Stopping factory -2018-05-08 14:12:20+0200 [-] (TCP Port 2103 Closed) -2018-05-08 14:12:20+0200 [-] Stopping factory -2018-05-08 14:12:20+0200 [-] (TCP Port 2076 Closed) -2018-05-08 14:12:20+0200 [-] Stopping factory -2018-05-08 14:12:20+0200 [-] (TCP Port 1992 Closed) -2018-05-08 14:12:20+0200 [-] Stopping factory -2018-05-08 14:12:20+0200 [-] (TCP Port 1879 Closed) -2018-05-08 14:12:20+0200 [-] Stopping factory -2018-05-08 14:12:20+0200 [-] (UDP Port 43893 Closed) -2018-05-08 14:12:20+0200 [-] Stopping protocol -2018-05-08 14:12:20+0200 [-] (TCP Port 1662 Closed) -2018-05-08 14:12:20+0200 [-] Stopping factory -2018-05-08 14:12:20+0200 [-] (TCP Port 2449 Closed) -2018-05-08 14:12:20+0200 [-] Stopping factory -2018-05-08 14:12:20+0200 [-] (TCP Port 2592 Closed) -2018-05-08 14:12:20+0200 [-] Stopping factory -2018-05-08 14:12:20+0200 [-] (TCP Port 1787 Closed) -2018-05-08 14:12:20+0200 [-] Stopping factory -2018-05-08 14:12:20+0200 [-] (TCP Port 1165 Closed) -2018-05-08 14:12:20+0200 [-] Stopping factory -2018-05-08 14:12:21+0200 [-] UDPEndpoint starting on 39570 -2018-05-08 14:12:21+0200 [-] Starting protocol -2018-05-08 14:12:21+0200 [-] Factory starting on 1050 -2018-05-08 14:12:21+0200 [-] Starting factory -2018-05-08 14:12:21+0200 [-] Factory starting on 1062 -2018-05-08 14:12:21+0200 [-] Starting factory -2018-05-08 14:12:21+0200 [-] Factory starting on 2063 -2018-05-08 14:12:21+0200 [-] Starting factory -2018-05-08 14:12:21+0200 [-] Factory starting on 2593 -2018-05-08 14:12:21+0200 [-] Starting factory -2018-05-08 14:12:21+0200 [-] Factory starting on 1024 -2018-05-08 14:12:21+0200 [-] Starting factory -2018-05-08 14:12:21+0200 [-] UDPEndpoint starting on 54763 -2018-05-08 14:12:21+0200 [-] Starting protocol -2018-05-08 14:12:21+0200 [-] Factory starting on 2078 -2018-05-08 14:12:21+0200 [-] Starting factory -2018-05-08 14:12:21+0200 [-] Factory starting on 1929 -2018-05-08 14:12:21+0200 [-] Starting factory -2018-05-08 14:12:21+0200 [-] Factory starting on 2094 -2018-05-08 14:12:21+0200 [-] Starting factory -2018-05-08 14:12:21+0200 [-] Factory starting on 2512 -2018-05-08 14:12:21+0200 [-] Starting factory -2018-05-08 14:12:21+0200 [-] Factory starting on 1635 -2018-05-08 14:12:21+0200 [-] Starting factory -2018-05-08 14:12:22+0200 [-] UDPEndpoint starting on 9704 -2018-05-08 14:12:22+0200 [-] Starting protocol -2018-05-08 14:12:52+0200 [-] (UDP Port 9704 Closed) -2018-05-08 14:12:52+0200 [-] Stopping protocol -2018-05-08 14:12:53+0200 [-] (TCP Port 2078 Closed) -2018-05-08 14:12:53+0200 [-] Stopping factory -2018-05-08 14:12:53+0200 [-] (TCP Port 1929 Closed) -2018-05-08 14:12:53+0200 [-] Stopping factory -2018-05-08 14:12:53+0200 [-] (TCP Port 2094 Closed) -2018-05-08 14:12:53+0200 [-] Stopping factory -2018-05-08 14:12:53+0200 [-] (TCP Port 2512 Closed) -2018-05-08 14:12:53+0200 [-] Stopping factory -2018-05-08 14:12:53+0200 [-] (TCP Port 1635 Closed) -2018-05-08 14:12:53+0200 [-] Stopping factory -2018-05-08 14:12:53+0200 [-] (UDP Port 54763 Closed) -2018-05-08 14:12:53+0200 [-] Stopping protocol -2018-05-08 14:12:53+0200 [-] (TCP Port 1050 Closed) -2018-05-08 14:12:53+0200 [-] Stopping factory -2018-05-08 14:12:53+0200 [-] (TCP Port 1062 Closed) -2018-05-08 14:12:53+0200 [-] Stopping factory -2018-05-08 14:12:53+0200 [-] (TCP Port 2063 Closed) -2018-05-08 14:12:53+0200 [-] Stopping factory -2018-05-08 14:12:53+0200 [-] (TCP Port 2593 Closed) -2018-05-08 14:12:53+0200 [-] Stopping factory -2018-05-08 14:12:53+0200 [-] (TCP Port 1024 Closed) -2018-05-08 14:12:53+0200 [-] Stopping factory -2018-05-08 14:12:54+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_circuit_reject_too_many <-- -2018-05-08 14:12:54+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_create_circuit_without_trustchain <-- -2018-05-08 14:12:54+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_decline_competing_slot <-- -2018-05-08 14:12:54+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_download_remove <-- -2018-05-08 14:12:54+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_empty_competing_slot <-- -2018-05-08 14:12:54+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_monitor_downloads_ih_pex <-- -2018-05-08 14:12:54+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_monitor_downloads_intro <-- -2018-05-08 14:12:54+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_monitor_downloads_recreate_ip <-- -2018-05-08 14:12:54+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_monitor_downloads_stop_all <-- -2018-05-08 14:12:54+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_monitor_downloads_stop_ip <-- -2018-05-08 14:12:54+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_payout_on_competition_kick <-- -2018-05-08 14:12:55+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_payouts <-- -2018-05-08 14:12:55+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_payouts_e2e <-- -2018-05-08 14:12:55+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_readd_bittorrent_peers <-- -2018-05-08 14:12:55+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_remove_circuit <-- -2018-05-08 14:12:55+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_update_torrent <-- -2018-05-08 14:12:55+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_win_competing_slot <-- -2018-05-08 14:12:55+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_win_competing_slot_exit <-- -2018-05-08 14:12:55+0200 [-] --> Tribler.Test.Community.Tunnel.test_community.TestTriblerTunnelCommunity.test_win_competing_slot_relay <-- diff --git a/Tribler/Test/Community/popular/test_community.py b/Tribler/Test/Community/popular/test_community.py index 0b529f47e22..66ed55008ec 100644 --- a/Tribler/Test/Community/popular/test_community.py +++ b/Tribler/Test/Community/popular/test_community.py @@ -2,8 +2,8 @@ import string from Tribler.Test.Core.base_test import MockObject -from Tribler.community.popular.community import PopularCommunity, MSG_TORRENT_HEALTH_RESPONSE, MAX_SUBSCRIBERS, \ - MSG_CHANNEL_HEALTH_RESPONSE, ERROR_UNKNOWN_PEER, MSG_POPULAR_CONTENT_SUBSCRIPTION, ERROR_NO_CONTENT, \ +from Tribler.community.popular.community import PopularCommunity, MSG_TORRENT_HEALTH_RESPONSE, \ + MSG_CHANNEL_HEALTH_RESPONSE, ERROR_UNKNOWN_PEER, MSG_SUBSCRIPTION, ERROR_NO_CONTENT, \ ERROR_UNKNOWN_RESPONSE from Tribler.community.popular.constants import SEARCH_TORRENT_REQUEST from Tribler.community.popular.payload import SearchResponseItemPayload @@ -100,11 +100,31 @@ def test_subscribe_peers(self): yield self.deliver_messages() # Node 0 should have a publisher added - self.assertEqual(len(self.nodes[0].overlay.publishers), 1, "Expected one publisher") + self.assertGreater(len(self.nodes[0].overlay.publishers), 0, "Publisher expected") # Node 1 should have a subscriber added + self.assertGreater(len(self.nodes[1].overlay.subscribers), 0, "Subscriber expected") + + @twisted_wrapper + def test_subscribe_unsubscribe_individual_peers(self): + """ + Tests subscribing/subscribing an individual peer. + """ + self.nodes[1].overlay.publish_latest_torrents = lambda *args, **kwargs: None + + yield self.introduce_nodes() + self.nodes[0].overlay.subscribe(self.nodes[1].my_peer, subscribe=True) + yield self.deliver_messages() + + self.assertEqual(len(self.nodes[0].overlay.publishers), 1, "Expected one publisher") self.assertEqual(len(self.nodes[1].overlay.subscribers), 1, "Expected one subscriber") - def test_unsubscribe_peers(self): + self.nodes[0].overlay.subscribe(self.nodes[1].my_peer, subscribe=False) + yield self.deliver_messages() + + self.assertEqual(len(self.nodes[0].overlay.publishers), 0, "Expected no publisher") + self.assertEqual(len(self.nodes[1].overlay.subscribers), 0, "Expected no subscriber") + + def test_unsubscribe_peers_unit(self): """ Tests unsubscribing peer works as expected. """ @@ -112,7 +132,7 @@ def send_popular_content_subscribe(my_peer, _, subscribe): if not subscribe: my_peer.unsubsribe_called += 1 - self.nodes[0].overlay.send_popular_content_subscribe = lambda peer, subscribe: \ + self.nodes[0].overlay.subscribe = lambda peer, subscribe: \ send_popular_content_subscribe(self.nodes[0], peer, subscribe) # Add some peers @@ -189,7 +209,7 @@ def on_torrent_health_response(peer, source_address, data): # Add something to queue health_info = ('a' * 20, random.randint(1, 100), random.randint(1, 10), random.randint(1, 111111)) - self.nodes[1].overlay._queue_content(TYPE_TORRENT_HEALTH, health_info) + self.nodes[1].overlay.queue_content(TYPE_TORRENT_HEALTH, health_info) self.nodes[1].overlay.publish_next_content() @@ -222,7 +242,7 @@ def test_publish_no_content(self): self.nodes[0].overlay.logger = original_logger @twisted_wrapper - def test_send_popular_content_subscribe(self): + def test_subscribe_unsubscribe(self): """ Tests sending popular content subscribe request. """ @@ -237,20 +257,10 @@ def test_send_popular_content_subscribe(self): # Assuming only one is connected self.nodes[0].overlay.get_peers = lambda: default_peers[:1] - # Case1: Try to send subscribe request to non-connected peer - self.nodes[0].unknown_peer_found = False - self.nodes[0].logger_error_called = False - self.nodes[0].overlay.send_popular_content_subscribe(default_peers[1], subscribe=True) - yield self.deliver_messages() - - # Expected unknown peer error log - self.assertTrue(self.nodes[0].logger_error_called) - self.assertTrue(self.nodes[0].unknown_peer_found) - - # Case2: Try to send subscribe request to connected peer + # Case1: Try to send subscribe request to connected peer self.nodes[0].broadcast_called = False self.nodes[0].broadcast_packet_type = None - self.nodes[0].overlay.send_popular_content_subscribe(default_peers[0], subscribe=True) + self.nodes[0].overlay.subscribe(default_peers[0], subscribe=True) yield self.deliver_messages() # Expect peer to be listed in publisher list and message to be sent @@ -259,7 +269,7 @@ def test_send_popular_content_subscribe(self): self.assertEqual(self.nodes[0].receiver, default_peers[0], "Intended publisher is different") # Try unsubscribing now - self.nodes[0].overlay.send_popular_content_subscribe(default_peers[0], subscribe=False) + self.nodes[0].overlay.subscribe(default_peers[0], subscribe=False) yield self.deliver_messages() # peer should no longer be in publisher list @@ -289,7 +299,7 @@ def test_send_popular_content_subscription(self): # Case1: Try to send subscribe response to non-connected peer self.nodes[0].unknown_peer_found = False self.nodes[0].logger_error_called = False - self.nodes[0].overlay.send_popular_content_subscription(default_peers[1], subscribed=True) + self.nodes[0].overlay.send_subscription_status(default_peers[1], subscribed=True) yield self.deliver_messages() # Expected unknown peer error log @@ -299,12 +309,12 @@ def test_send_popular_content_subscription(self): # Case2: Try to send response to the connected peer self.nodes[0].broadcast_called = False self.nodes[0].broadcast_packet_type = None - self.nodes[0].overlay.send_popular_content_subscription(default_peers[0], subscribed=True) + self.nodes[0].overlay.send_subscription_status(default_peers[0], subscribed=True) yield self.deliver_messages() # Expect message to be sent self.assertTrue(self.nodes[0].packet_created, "Create packet failed") - self.assertEqual(self.nodes[0].packet_type, MSG_POPULAR_CONTENT_SUBSCRIPTION, "Unexpected payload type found") + self.assertEqual(self.nodes[0].packet_type, MSG_SUBSCRIPTION, "Unexpected payload type found") self.assertTrue(self.nodes[0].broadcast_called, "Should send a message to the peer") self.assertEqual(self.nodes[0].receiver, default_peers[0], "Intended receiver is different") @@ -450,7 +460,7 @@ def fake_get_peer_from_auth(peer): def fake_publish_latest_torrents(my_peer, _peer): my_peer.publish_latest_torrents_called = True - self.nodes[0].overlay._publish_latest_torrents = lambda peer: fake_publish_latest_torrents(self.nodes[1], peer) + self.nodes[0].overlay.publish_latest_torrents = lambda peer: fake_publish_latest_torrents(self.nodes[1], peer) self.nodes[0].overlay._ez_unpack_auth = lambda payload_class, data: fake_unpack_auth() self.nodes[0].overlay.get_peer_from_auth = lambda auth, address: fake_get_peer_from_auth(self.nodes[1]) @@ -458,7 +468,7 @@ def fake_publish_latest_torrents(my_peer, _peer): data = MockObject() self.nodes[0].unknown_peer_found = False - self.nodes[0].overlay.on_popular_content_subscribe(source_address, data) + self.nodes[0].overlay.on_subscribe(source_address, data) yield self.deliver_messages() self.assertTrue(self.nodes[0].unknown_peer_found) @@ -489,16 +499,16 @@ def fake_publish_latest_torrents(my_peer, _peer): def fake_send_popular_content_subscription(my_peer): my_peer.send_content_subscription_called = True - self.nodes[0].overlay._publish_latest_torrents = lambda peer: fake_publish_latest_torrents(self.nodes[0], peer) + self.nodes[0].overlay.publish_latest_torrents = lambda peer: fake_publish_latest_torrents(self.nodes[0], peer) self.nodes[0].overlay._ez_unpack_auth = lambda payload_class, data: fake_unpack_auth() self.nodes[0].overlay.get_peer_from_auth = lambda auth, address: fake_get_peer_from_auth(self.nodes[1]) - self.nodes[0].overlay.send_popular_content_subscription = lambda peer, subscribed: \ + self.nodes[0].overlay.send_subscription_status = lambda peer, subscribed: \ fake_send_popular_content_subscription(self.nodes[1]) source_address = MockObject() data = MockObject() self.nodes[0].unknown_peer_found = False - self.nodes[0].overlay.on_popular_content_subscribe(source_address, data) + self.nodes[0].overlay.on_subscribe(source_address, data) yield self.deliver_messages() self.assertFalse(self.nodes[0].unknown_peer_found) @@ -553,10 +563,3 @@ def fake_create_message_packet(self, my_peer, _type, _payload): def fake_broadcast_message(self, my_peer, _, peer): my_peer.broadcast_called = True my_peer.receiver = peer - - def test_add_or_ignore_subscriber(self): - # Add successfully until max subscriber - for _ in range(MAX_SUBSCRIBERS): - self.assertTrue(self.nodes[0].overlay.add_or_ignore_subscriber(self.create_node())) - # Adding anymore subscriber should return false - self.assertFalse(self.nodes[0].overlay.add_or_ignore_subscriber(self.create_node())) diff --git a/Tribler/Test/test_as_server.py b/Tribler/Test/test_as_server.py index 093464718fe..76d741873c3 100644 --- a/Tribler/Test/test_as_server.py +++ b/Tribler/Test/test_as_server.py @@ -298,6 +298,7 @@ def setUpPreSession(self): self.config.set_tunnel_community_enabled(False) self.config.set_credit_mining_enabled(False) self.config.set_market_community_enabled(False) + self.config.set_popular_community_enabled(False) @blocking_call_on_reactor_thread @inlineCallbacks diff --git a/Tribler/community/popular/community.py b/Tribler/community/popular/community.py index 635f4ec431f..497583af31a 100644 --- a/Tribler/community/popular/community.py +++ b/Tribler/community/popular/community.py @@ -1,18 +1,19 @@ import logging +from abc import abstractmethod from copy import copy from twisted.internet.defer import inlineCallbacks from twisted.internet.task import LoopingCall from Tribler.Core.simpledefs import SIGNAL_SEARCH_COMMUNITY, SIGNAL_ON_SEARCH_RESULTS -from Tribler.community.popular.constants import MSG_POPULAR_CONTENT_SUBSCRIBE, MSG_POPULAR_CONTENT_SUBSCRIPTION, \ +from Tribler.community.popular.constants import MSG_SUBSCRIBE, MSG_SUBSCRIPTION, \ MSG_TORRENT_HEALTH_RESPONSE, MSG_CHANNEL_HEALTH_RESPONSE, MSG_TORRENT_INFO_REQUEST, MSG_TORRENT_INFO_RESPONSE, \ - MSG_SEARCH_REQUEST, MSG_SEARCH_RESPONSE, MAX_PUBLISHERS, PUBLISH_INTERVAL, MAX_SUBSCRIBERS, \ - ERROR_UNKNOWN_RESPONSE, TORRENT_SEARCH_RESPONSE_TYPE, CHANNEL_SEARCH_RESPONSE_TYPE, TYPE_CHANNEL, \ - MAX_PACKET_PAYLOAD_SIZE, ERROR_UNKNOWN_PEER, ERROR_NO_CONTENT, MASTER_PUBLIC_KEY, MSG_CONTENT_INFO_REQUEST, \ + MAX_PUBLISHERS, PUBLISH_INTERVAL, MAX_SUBSCRIBERS, \ + ERROR_UNKNOWN_RESPONSE, MAX_PACKET_PAYLOAD_SIZE, ERROR_UNKNOWN_PEER, ERROR_NO_CONTENT, MASTER_PUBLIC_KEY, \ + MSG_CONTENT_INFO_REQUEST, \ SEARCH_TORRENT_REQUEST, MSG_CONTENT_INFO_RESPONSE, SEARCH_TORRENT_RESPONSE from Tribler.community.popular.payload import TorrentHealthPayload, ContentSubscription, TorrentInfoRequestPayload, \ - TorrentInfoResponsePayload, SearchRequestPayload, SearchResponsePayload, SearchResponseItemPayload, \ - ChannelItemPayload, ContentInfoRequest, Pagination, ContentInfoResponse + TorrentInfoResponsePayload, SearchResponseItemPayload, \ + ContentInfoRequest, Pagination, ContentInfoResponse, decode_values from Tribler.community.popular.repository import ContentRepository, TYPE_TORRENT_HEALTH from Tribler.community.popular.request import SearchRequest from Tribler.pyipv8.ipv8.deprecated.community import Community @@ -30,8 +31,8 @@ def __init__(self, *args, **kwargs): # Register messages self.decode_map.update({ - chr(MSG_POPULAR_CONTENT_SUBSCRIBE): self.on_popular_content_subscribe, - chr(MSG_POPULAR_CONTENT_SUBSCRIPTION): self.on_popular_content_subscription + chr(MSG_SUBSCRIBE): self.on_subscribe, + chr(MSG_SUBSCRIPTION): self.on_subscription_status }) # A set of publisher and subscriber. @@ -78,7 +79,7 @@ def subscribe_peers(self): key=lambda _peer: self.trustchain.get_trust(_peer) if self.trustchain else 1, reverse=True) for peer in sorted_peers[: MAX_PUBLISHERS - num_publishers]: - self.send_popular_content_subscribe(peer, subscribe=True) + self.subscribe(peer, subscribe=True) def refresh_peer_list(self): """ @@ -103,18 +104,14 @@ def unsubscribe_peers(self): - Called at community unload. """ for peer in copy(self.publishers): - self.send_popular_content_subscribe(peer, subscribe=False) + self.subscribe(peer, subscribe=False) self.publishers.clear() - def send_popular_content_subscribe(self, peer, subscribe=True): + def subscribe(self, peer, subscribe=True): """ Method to send content subscribe/unsubscribe message. This message is sent to each individual publisher peer we want to subscribe/unsubscribe. """ - if peer not in self.get_peers(): - self.logger.error(ERROR_UNKNOWN_PEER) - return - # Add or remove the publisher peer if subscribe: self.publishers.add(peer) @@ -123,10 +120,10 @@ def send_popular_content_subscribe(self, peer, subscribe=True): # Create subscription packet and send it subscription = ContentSubscription(subscribe) - packet = self.create_message_packet(MSG_POPULAR_CONTENT_SUBSCRIBE, subscription) + packet = self.create_message_packet(MSG_SUBSCRIBE, subscription) self.broadcast_message(packet, peer=peer) - def on_popular_content_subscribe(self, source_address, data): + def on_subscribe(self, source_address, data): """ Message handler for content subscribe message. It handles both subscribe and unsubscribe requests. Upon successful subscription or unsubscription, it send the confirmation subscription message with status. @@ -148,11 +145,11 @@ def on_popular_content_subscribe(self, source_address, data): subscribed = False # Send subscription response - self.send_popular_content_subscription(peer, subscribed=subscribed) + self.send_subscription_status(peer, subscribed=subscribed) return subscribed - def send_popular_content_subscription(self, peer, subscribed=True): + def send_subscription_status(self, peer, subscribed=True): """ Method to send content subscription message. Content subscription message is send in response to content subscribe or unsubscribe message. @@ -162,10 +159,10 @@ def send_popular_content_subscription(self, peer, subscribed=True): return subscription = ContentSubscription(subscribed) - packet = self.create_message_packet(MSG_POPULAR_CONTENT_SUBSCRIPTION, subscription) + packet = self.create_message_packet(MSG_SUBSCRIPTION, subscription) self.broadcast_message(packet, peer=peer) - def on_popular_content_subscription(self, source_address, data): + def on_subscription_status(self, source_address, data): """ Message handler for content subscription message. Content subscription message is sent by the publisher stating the status of the subscription in response to subscribe or unsubscribe request. @@ -201,16 +198,6 @@ def broadcast_message(self, packet, peer=None): for _peer in self.subscribers: self.endpoint.send(_peer.address, packet) - def add_or_ignore_subscriber(self, peer): - """ - Helper method to add or ignore new subscriber peer. If we already have max subscriber, the peer is not able to - subscribe. - """ - if len(self.subscribers) < MAX_SUBSCRIBERS: - self.subscribers.add(peer) - return True - return False - def get_peer_from_auth(self, auth, source_address): """ Get Peer object from the message and auth and source_address. @@ -236,8 +223,9 @@ def pack_sized(self, payload_list, fit_size, start_index=0): current_index += 1 return serialized_results, current_index, current_index - start_index - # Abstract methods + @abstractmethod def publish_next_content(self): + """ Method responsible for publishing content during periodic push """ pass @@ -265,8 +253,6 @@ def __init__(self, *args, **kwargs): chr(MSG_CHANNEL_HEALTH_RESPONSE): self.on_channel_health_response, chr(MSG_TORRENT_INFO_REQUEST): self.on_torrent_info_request, chr(MSG_TORRENT_INFO_RESPONSE): self.on_torrent_info_response, - chr(MSG_SEARCH_REQUEST): self.on_search_request, - chr(MSG_SEARCH_RESPONSE): self.on_search_response, chr(MSG_CONTENT_INFO_REQUEST): self.on_content_info_request, chr(MSG_CONTENT_INFO_RESPONSE): self.on_content_info_response }) @@ -279,14 +265,14 @@ def unload(self): self.content_repository = None yield super(PopularCommunity, self).unload() - def on_popular_content_subscribe(self, source_address, data): + def on_subscribe(self, source_address, data): auth, _, _ = self._ez_unpack_auth(ContentSubscription, data) peer = self.get_peer_from_auth(auth, source_address) - subscribed = super(PopularCommunity, self).on_popular_content_subscribe(source_address, data) + subscribed = super(PopularCommunity, self).on_subscribe(source_address, data) # Publish the latest torrents to the subscriber if subscribed: - self._publish_latest_torrents(peer=peer) + self.publish_latest_torrents(peer=peer) def on_torrent_health_response(self, source_address, data): """ @@ -327,7 +313,7 @@ def on_torrent_info_request(self, source_address, data): self.logger.error(ERROR_UNKNOWN_RESPONSE) return - self.send_torrent_info_response(str(payload.infohash), peer=peer) + self.send_torrent_info_response(payload.infohash, peer=peer) def on_torrent_info_response(self, source_address, data): """ @@ -343,48 +329,6 @@ def on_torrent_info_response(self, source_address, data): self.content_repository.update_torrent_info(payload) - def on_search_request(self, source_address, data): - """ Message handler for search request """ - self.logger.info("Got search request from %s", source_address) - auth, _, payload = self._ez_unpack_auth(SearchRequestPayload, data) - peer = self.get_peer_from_auth(auth, source_address) - self.logger.info("Search query:%s", payload.query) - self.logger.info("Search type:%s", "torrent" if payload.search_type == 0 else "channel") - - if payload.search_type == TORRENT_SEARCH_RESPONSE_TYPE: - db_results = self.content_repository.search_torrent(payload.query) - self.logger.info("Search results: torrents[%s]", len(db_results)) - self.send_search_response(peer, payload.identifier, TORRENT_SEARCH_RESPONSE_TYPE, db_results) - - def on_search_response(self, source_address, data): - """ Message handlder for search response """ - self.logger.info("Got search response from %s", source_address) - _, _, payload = self._ez_unpack_auth(SearchResponsePayload, data) - - # get the original search request cache - identifier = int(payload.identifier) - cache = self.request_cache.pop(u'request', identifier) - if cache is None: - return - - if payload.response_type == TORRENT_SEARCH_RESPONSE_TYPE: - # De-serialize the response payload results to obtain individual search result items - item_format = SearchResponseItemPayload.format_list - (all_items, _) = self.serializer.unpack_multiple_as_list(item_format, payload.results) - - self.content_repository.update_from_torrent_search_results(all_items) - if self.tribler_session: - self.tribler_session.notifier.notify(SIGNAL_SEARCH_COMMUNITY, SIGNAL_ON_SEARCH_RESULTS, None, all_items) - - cache.deferred.callback(all_items) - elif payload.response_type == CHANNEL_SEARCH_RESPONSE_TYPE: - # De-serialize the response payload results to obtain individual search result items - item_format = ChannelItemPayload.format_list - (all_items, _) = self.serializer.unpack_multiple_as_list(item_format, payload.results) - - self.content_repository.update_from_channel_search_results(all_items) - cache.deferred.callback(all_items) - def on_content_info_request(self, source_address, data): auth, _, payload = self._ez_unpack_auth(ContentInfoRequest, data) peer = self.get_peer_from_auth(auth, source_address) @@ -411,6 +355,9 @@ def on_content_info_response(self, source_address, data): def process_torrent_search_response(self, query, payload): item_format = SearchResponseItemPayload.format_list (response, _) = self.serializer.unpack_multiple_as_list(item_format, payload.response) + # Decode the category string to list + for response_item in response: + response_item[4] = decode_values(response_item[4]) self.content_repository.update_from_torrent_search_results(response) @@ -509,39 +456,7 @@ def send_torrent_search_request(self, query): self.send_content_info_request(SEARCH_TORRENT_REQUEST, query) def send_channel_search_request(self, query): - self._send_search_request(TYPE_CHANNEL, query) - - def _send_search_request(self, search_type, query): - query = ''.join(query) - # Register fetch identifier - cache = self.request_cache.add(SearchRequest(self.request_cache, search_type, query)) - self.logger.info("Sending search request query:%s, identifier:%s", query, cache.number) - - # Create search request - search_request_payload = SearchRequestPayload(cache.number, search_type, query) - packet = self.create_message_packet(MSG_SEARCH_REQUEST, search_request_payload) - - # Send the request to search peers - for peer in self.get_peers(): - self.broadcast_message(packet, peer=peer) - - def send_search_response(self, peer, identifier, response_type, results): - # Serialize the results - size = 0 - serialized_results = '' - for item in results: - packed_item = self.serializer.pack_multiple(item.to_pack_list()) - packed_item_length = len(packed_item) - if size + packed_item_length > MAX_PACKET_PAYLOAD_SIZE: - break - else: - size += packed_item_length - serialized_results += packed_item - - # Prepare the payload packet and send it to the peer - search_response_payload = SearchResponsePayload(identifier, response_type, serialized_results) - packet = self.create_message_packet(MSG_SEARCH_RESPONSE, search_response_payload) - self.broadcast_message(packet, peer=peer) + raise NotImplementedError("Not implemented yet. Waiting for all channel 2.0") # CONTENT REPOSITORY STUFFS @@ -567,7 +482,7 @@ def publish_next_content(self): payload = TorrentHealthPayload(infohash, seeders, leechers, timestamp) self.send_torrent_health_response(payload) - def _publish_latest_torrents(self, peer): + def publish_latest_torrents(self, peer): """ Publishes the latest torrents in local database to the given peer. """ @@ -578,7 +493,7 @@ def _publish_latest_torrents(self, peer): payload = TorrentHealthPayload(infohash, seeders, leechers, timestamp) self.send_torrent_health_response(payload, peer=peer) - def _queue_content(self, content_type, content): + def queue_content(self, content_type, content): """ Basically addS a given content to the queue of content repository. """ diff --git a/Tribler/community/popular/constants.py b/Tribler/community/popular/constants.py index 1c7ffe42f0d..f6163857129 100644 --- a/Tribler/community/popular/constants.py +++ b/Tribler/community/popular/constants.py @@ -5,8 +5,8 @@ "d10da3744b65679828f23376e28b76ab33132b7fa984a77f159dba7351a7" # Message types for different requests & response -MSG_POPULAR_CONTENT_SUBSCRIBE = 1 -MSG_POPULAR_CONTENT_SUBSCRIPTION = 2 +MSG_SUBSCRIBE = 1 +MSG_SUBSCRIPTION = 2 MSG_TORRENT_HEALTH_RESPONSE = 3 MSG_CHANNEL_HEALTH_RESPONSE = 4 MSG_TORRENT_INFO_REQUEST = 5 diff --git a/Tribler/community/popular/payload.py b/Tribler/community/popular/payload.py index 5d3b31c86e8..0f585534a8e 100644 --- a/Tribler/community/popular/payload.py +++ b/Tribler/community/popular/payload.py @@ -21,20 +21,18 @@ def decode_values(values_str): class ContentSubscription(Payload): - format_list = ['I'] + format_list = ['?'] def __init__(self, subscribe): super(ContentSubscription, self).__init__() self.subscribe = subscribe def to_pack_list(self): - data = [('I', self.subscribe)] - + data = [('?', self.subscribe)] return data @classmethod - def from_unpack_list(cls, *args): - (subscribe) = args + def from_unpack_list(cls, subscribe): return ContentSubscription(subscribe) @@ -117,21 +115,17 @@ class TorrentInfoRequestPayload(Payload): def __init__(self, infohash): super(TorrentInfoRequestPayload, self).__init__() - self._infohash = infohash + self.infohash = infohash def to_pack_list(self): - data = [('20s', self.infohash)] + data = [('20s', str(self.infohash))] return data @classmethod def from_unpack_list(cls, *args): - (infohash) = args + infohash = args return TorrentInfoRequestPayload(infohash) - @property - def infohash(self): - return self._infohash - class TorrentInfoResponsePayload(Payload): """ diff --git a/Tribler/community/popular/repository.py b/Tribler/community/popular/repository.py index 046429c544e..5d3e0925b87 100644 --- a/Tribler/community/popular/repository.py +++ b/Tribler/community/popular/repository.py @@ -126,8 +126,9 @@ def search_channels(self, query): def update_from_torrent_search_results(self, search_results): for result in search_results: - torrent_item = SearchResponseItemPayload.from_unpack_list(*tuple(result)) - infohash = torrent_item.infohash + (infohash, name, length, num_files, category_list, creation_date, seeders, leechers, cid) = result + torrent_item = SearchResponseItemPayload(infohash, name, length, num_files, category_list, + creation_date, seeders, leechers, cid) if self.has_torrent(infohash): db_torrent = self.get_torrent(infohash) if db_torrent['name'] and db_torrent['name'] == torrent_item.name: diff --git a/Tribler/community/popular/request.py b/Tribler/community/popular/request.py index 6faeb506a23..3fefb85f996 100644 --- a/Tribler/community/popular/request.py +++ b/Tribler/community/popular/request.py @@ -1,41 +1,14 @@ -import time from twisted.internet.defer import Deferred from twisted.python.failure import Failure from Tribler.pyipv8.ipv8.requestcache import RandomNumberCache -class Request(RandomNumberCache): - """ - This request cache keeps track of all outstanding requests within the PopularCommunity. - """ - def __init__(self, community, peer, params=None): - super(Request, self).__init__(community.request_cache, u'request') - self.peer = peer - self.params = params - self.deferred = Deferred() - self.start_time = time.time() - - @property - def timeout_delay(self): - return 5.0 - - def on_timeout(self): - if not self.deferred.called: - self._logger.error('Request to %s timed out', self.peer.address) - self.peer.failed += 1 - self.deferred.errback(Failure(RuntimeError("Peer timeout"))) - - def on_complete(self): - self.peer.last_response = time.time() - self.peer.failed = 0 - self.peer.rtt = time.time() - self.start_time - - class SearchRequest(RandomNumberCache): """ This request cache keeps track of all outstanding search requests """ + def __init__(self, request_cache, search_type, query): super(SearchRequest, self).__init__(request_cache, u"request") self.query = query