From 295a4dc979a55d8203d3d03e84df83b6a7b0ab82 Mon Sep 17 00:00:00 2001 From: qstokkink Date: Sat, 2 Jul 2016 16:26:07 +0200 Subject: [PATCH] Push for testing new protocol, minus channel-search, missing-channel --- Tribler/community/allchannel/community.py | 6 ++++-- Tribler/community/allchannel/compatibility.py | 3 ++- Tribler/community/bartercast4/community.py | 2 +- Tribler/community/channel/community.py | 6 ++++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Tribler/community/allchannel/community.py b/Tribler/community/allchannel/community.py index 2f874175976..df2545fb616 100644 --- a/Tribler/community/allchannel/community.py +++ b/Tribler/community/allchannel/community.py @@ -103,7 +103,7 @@ def __init__(self, *args, **kwargs): # TODO REMOVE BACKWARD COMPATIBILITY: Delete the following 2 assignments self.compatibility = AllChannelCompatibility(self) - self.compatibility_mode = True + self.compatibility_mode = False self._blocklist = {} self._recentlyRequested = [] @@ -315,7 +315,9 @@ def create_channelsearch(self, keywords): query = " ".join(keywords) # TODO REMOVE BACKWARD COMPATIBILITY: Delete if statement and positive case - if self.compatibility_mode: + # TODO DEBUG: Allow for remote channelsearches using old protocol + # if self.compatibility_mode: + if True: meta = self.get_meta_message(u"channelsearch") message = meta.impl(authentication=(self._my_member,), distribution=(self.global_time,), diff --git a/Tribler/community/allchannel/compatibility.py b/Tribler/community/allchannel/compatibility.py index 441c245fb86..b82a4ff12e1 100644 --- a/Tribler/community/allchannel/compatibility.py +++ b/Tribler/community/allchannel/compatibility.py @@ -389,6 +389,7 @@ def on_votecast(self, messages): self.parent.on_votecast(message, self._reconstruct_votecast(message)) def undo_votecast(self, descriptors, redo=False): - for message in messages: + for _, _, packet in descriptors: + message = packet.load_message() self.parent.undo_votecast(message, self._reconstruct_votecast(message), redo) diff --git a/Tribler/community/bartercast4/community.py b/Tribler/community/bartercast4/community.py index fbe5ad2f91b..e656cade4f3 100644 --- a/Tribler/community/bartercast4/community.py +++ b/Tribler/community/bartercast4/community.py @@ -44,7 +44,7 @@ def __init__(self, dispersy, master, my_member): # TODO REMOVE BACKWARD COMPATIBILITY: Delete the following 2 assignments self.compatibility = Bartercast4Compatibility(self) - self.compatibility_mode = True + self.compatibility_mode = False # add task for persisting bartercast statistics every BARTERCAST_PERSIST_INTERVAL seconds self._logger.debug("bartercast persist task started") diff --git a/Tribler/community/channel/community.py b/Tribler/community/channel/community.py index cef5807c38b..238b5478845 100644 --- a/Tribler/community/channel/community.py +++ b/Tribler/community/channel/community.py @@ -55,7 +55,7 @@ def __init__(self, *args, **kwargs): # TODO REMOVE BACKWARD COMPATIBILITY: Delete the following 2 assignments self.compatibility = ChannelCompatibility(self) - self.compatibility_mode = True + self.compatibility_mode = False self._channel_id = None self._channel_name = None @@ -1185,7 +1185,9 @@ def undo_mark_torrent(self, header, message, redo=False): def disp_create_missing_channel(self, candidate, includeSnapshot): logger.debug("%s sending missing-channel %s %s", candidate, self._cid.encode("HEX"), includeSnapshot) # TODO REMOVE BACKWARD COMPATIBILITY: Delete if statement and positive case - if self.compatibility_mode: + # TODO DEBUG: Allow for remote missing channels using old protocol + # if self.compatibility_mode: + if True: meta = self._meta_messages[u"missing-channel"] request = meta.impl(distribution=(self.global_time,), destination=(candidate,), payload=(includeSnapshot,)) self._dispersy._forward([request])