Package: mldonkey-server
Version: 2.9.5-2+lenny1
Severity: normal
Tags: patch

Some torrent files are discarded by mldonkey with this message in log:
[BT] Error Failure("hd") in scan_new_torrents_directory for
file.torrent, moved to torrents/old ...
3.0.0-3 from squeeze is also affected.

I tried to fix this, and it turns out that some internal list is empty
when program tries to get it's first element.
This patch checks list length before using it. Works fine for me.

Sample torrent:
http://www.mininova.org/tor/3070173

Upstream bug report:
https://savannah.nongnu.org/bugs/index.php?27781


-- System Information:
Debian Release: 5.0.3
  APT prefers stable
  APT policy: (990, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-2-openvz-686 (SMP w/1 CPU core)
Locale: LANG=ru_RU.koi8r, LC_CTYPE=ru_RU.koi8r (charmap=KOI8-R)
Shell: /bin/sh linked to /bin/bash

Versions of packages mldonkey-server depends on:
ii  adduser                3.110             add and remove users and groups
ii  debconf [debconf-2.0]  1.5.24            Debian configuration management sy
ii  dpkg                   1.14.25           Debian package management system
ii  libbz2-1.0             1.0.5-1           high-quality block-sorting file co
ii  libc6                  2.7-18            GNU C Library: Shared libraries
ii  libfreetype6           2.3.7-2+lenny1    FreeType 2 font engine, shared lib
ii  libgcc1                1:4.3.2-1.1       GCC support library
ii  libgd2-noxpm           2.0.36~rc1~dfsg-3 GD Graphics Library version 2 (wit
ii  libjpeg62              6b-14             The Independent JPEG Group's JPEG 
ii  libpng12-0             1.2.27-2+lenny2   PNG library - runtime
ii  libstdc++6             4.3.2-1.1         The GNU Standard C++ Library v3
ii  mime-support           3.44-1            MIME files 'mime.types' & 'mailcap
ii  ucf                    3.0016            Update Configuration File: preserv
ii  zlib1g                 1:1.2.3.3.dfsg-12 compression library - runtime

mldonkey-server recommends no packages.

Versions of packages mldonkey-server suggests:
pn  makejail                      <none>     (no description available)

-- debconf information excluded
diff -r 68746b87145b bTTorrent.ml
--- a/src/networks/bittorrent/bTTorrent.ml	Thu Oct 22 20:52:45 2009 +0700
+++ b/src/networks/bittorrent/bTTorrent.ml	Thu Oct 22 20:54:10 2009 +0700
@@ -168,7 +168,7 @@
                             next_urls := List2.shuffle !next_urls;
                             announce_list := !next_urls @ !announce_list
                           end
-                        else
+                        else if List.length !next_urls = 1 then
                           announce_list := List.hd !next_urls :: !announce_list
                     | _ ->
                         lprintf_nl "[BT] unknown field in announce list"

Reply via email to