From 4edfaa0493b25d31d9ab04999e70827f7f2cf74d Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 12 Sep 2006 00:48:01 +0000 Subject: [PATCH] fixed private=0 torrent parsing --- src/torrent_info.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/torrent_info.cpp b/src/torrent_info.cpp index c384070ed..6499574df 100755 --- a/src/torrent_info.cpp +++ b/src/torrent_info.cpp @@ -270,11 +270,15 @@ namespace libtorrent m_extra_info[i->first] = i->second; } - if (info.find_key("private")) + if (entry const* priv = info.find_key("private")) { - // this key exists, don't care about its value, consider - // the torrent private - m_private = true; + if (priv->type() != entry::int_t + || priv->integer() != 0) + { + // this key exists and it's not 0. + // consider the torrent private + m_private = true; + } } #ifndef NDEBUG