Package: libtorrent11
Version: 0.12.5-2
Severity: normal
Tags: patch

Submitted upstream as bug 2008:
http://libtorrent.rakshasa.no/ticket/2008

I'm seeing the same issue as
http://libtorrent.rakshasa.no/ticket/1748

The server side is running Debian/stable with bittorrent 3.4.2-11.1, which 
doesn't support encryption. When I have encryption = 
allow_incoming,try_outgoing,enable_retry on the client side I see one attempted 
encrypted handshake, but no unencrypted retry in wireshark.

I've tracked this down to create_outgoing() filtering out the retry because of 
PeerList::connect_filter_recent. If I comment out the 
PeerList::connect_filter_recent retry works as expected.

I've tried checking this bug against SVN, but it doesn't compile: 
../../../rak/allocators.h:77: error: ‘L1_CACHE_BYTES’ was not declared in this 
scope 

The following hackish patch fixes this issue for me:
diff -Naru libtorrent.orig/src/protocol/handshake_manager.cc 
libtorrent-0.12.5/src/protocol/handshake_manager.cc
--- libtorrent.orig/src/protocol/handshake_manager.cc   2009-05-13 
22:04:11.000000000 +0900
+++ libtorrent-0.12.5/src/protocol/handshake_manager.cc 2009-12-15 
20:05:22.288137626 +0900
@@ -134,8 +134,12 @@
 
 void
 HandshakeManager::create_outgoing(const rak::socket_address& sa, DownloadMain* 
download, int encryptionOptions) {
+  int peerlist_options = PeerList::connect_keep_handshakes;
+  if (!(encryptionOptions & ConnectionManager::encryption_dont_filter_recent)) 
{
+    peerlist_options |= PeerList::connect_filter_recent;
+  }
   PeerInfo* peerInfo = download->peer_list()->connected(sa.c_sockaddr(),
-                                                        
PeerList::connect_keep_handshakes | PeerList::connect_filter_recent);
+                                                        peerlist_options);
 
   if (peerInfo == NULL || peerInfo->failed_counter() > max_failed)
     return;
@@ -266,6 +270,7 @@
                                                                e_none,
                                                                
&download->info()->hash());
 
+    retry_options |= ConnectionManager::encryption_dont_filter_recent;
     create_outgoing(*sa, download, retry_options);
   }
 
diff -Naru libtorrent.orig/src/torrent/connection_manager.h 
libtorrent-0.12.5/src/torrent/connection_manager.h
--- libtorrent.orig/src/torrent/connection_manager.h    2008-05-07 
21:19:13.000000000 +0900
+++ libtorrent-0.12.5/src/torrent/connection_manager.h  2009-12-15 
20:04:20.560262767 +0900
@@ -86,6 +86,7 @@
 
   // Internal to libtorrent.
   static const uint32_t encryption_use_proxy        = (1 << 6);
+  static const uint32_t encryption_dont_filter_recent = (1 << 7);
 
   enum {
     handshake_incoming           = 1,

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.32 (PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libtorrent11 depends on:
ii  libc6                         2.10.1-6   GNU C Library: Shared libraries
ii  libgcc1                       1:4.4.2-2  GCC support library
ii  libsigc++-2.0-0c2a            2.0.18-2   type-safe Signal Framework for C++
ii  libssl0.9.8                   0.9.8k-5   SSL shared libraries
ii  libstdc++6                    4.4.2-2    The GNU Standard C++ Library v3

libtorrent11 recommends no packages.

libtorrent11 suggests no packages.

-- no debconf information

-- debsums errors found:
debsums: changed file /usr/lib/libtorrent.so.11.0.5 (from libtorrent11 package)




--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to