2006-10-11 16:02:21 +02:00
|
|
|
/*
|
|
|
|
|
|
|
|
Copyright (c) 2006, Arvid Norberg
|
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
|
|
modification, are permitted provided that the following conditions
|
|
|
|
are met:
|
|
|
|
|
|
|
|
* Redistributions of source code must retain the above copyright
|
|
|
|
notice, this list of conditions and the following disclaimer.
|
|
|
|
* Redistributions in binary form must reproduce the above copyright
|
|
|
|
notice, this list of conditions and the following disclaimer in
|
|
|
|
the documentation and/or other materials provided with the distribution.
|
|
|
|
* Neither the name of the author nor the names of its
|
|
|
|
contributors may be used to endorse or promote products derived
|
|
|
|
from this software without specific prior written permission.
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
|
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TORRENT_SESSION_IMPL_HPP_INCLUDED
|
|
|
|
#define TORRENT_SESSION_IMPL_HPP_INCLUDED
|
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
#include <vector>
|
|
|
|
#include <set>
|
|
|
|
#include <list>
|
|
|
|
|
2008-04-05 06:53:22 +02:00
|
|
|
#ifndef TORRENT_DISABLE_GEO_IP
|
|
|
|
#include "libtorrent/GeoIP.h"
|
|
|
|
#endif
|
|
|
|
|
2006-10-11 16:02:21 +02:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
#pragma warning(push, 1)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <boost/filesystem/path.hpp>
|
|
|
|
#include <boost/thread.hpp>
|
2009-01-23 18:06:23 +01:00
|
|
|
#include <boost/thread/condition.hpp>
|
2009-05-07 00:36:24 +02:00
|
|
|
#include <boost/pool/object_pool.hpp>
|
2006-10-11 16:02:21 +02:00
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#pragma warning(pop)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "libtorrent/torrent_handle.hpp"
|
|
|
|
#include "libtorrent/entry.hpp"
|
|
|
|
#include "libtorrent/socket.hpp"
|
|
|
|
#include "libtorrent/peer_id.hpp"
|
|
|
|
#include "libtorrent/tracker_manager.hpp"
|
|
|
|
#include "libtorrent/debug.hpp"
|
|
|
|
#include "libtorrent/piece_block_progress.hpp"
|
|
|
|
#include "libtorrent/ip_filter.hpp"
|
|
|
|
#include "libtorrent/config.hpp"
|
|
|
|
#include "libtorrent/session_settings.hpp"
|
|
|
|
#include "libtorrent/session_status.hpp"
|
|
|
|
#include "libtorrent/session.hpp"
|
|
|
|
#include "libtorrent/stat.hpp"
|
2006-11-14 16:53:38 +01:00
|
|
|
#include "libtorrent/file_pool.hpp"
|
2007-01-10 16:02:25 +01:00
|
|
|
#include "libtorrent/bandwidth_manager.hpp"
|
2007-04-25 20:26:35 +02:00
|
|
|
#include "libtorrent/socket_type.hpp"
|
2007-05-05 02:29:33 +02:00
|
|
|
#include "libtorrent/connection_queue.hpp"
|
2007-06-10 22:46:09 +02:00
|
|
|
#include "libtorrent/disk_io_thread.hpp"
|
2009-05-03 22:21:24 +02:00
|
|
|
#include "libtorrent/udp_socket.hpp"
|
2007-09-10 08:12:41 +02:00
|
|
|
#include "libtorrent/assert.hpp"
|
2009-05-07 00:36:24 +02:00
|
|
|
#include "libtorrent/policy.hpp" // for policy::peer
|
2009-05-07 22:30:20 +02:00
|
|
|
#include "libtorrent/alert.hpp" // for alert_manager
|
2006-10-11 16:02:21 +02:00
|
|
|
|
|
|
|
namespace libtorrent
|
|
|
|
{
|
|
|
|
|
2007-06-10 22:46:09 +02:00
|
|
|
namespace fs = boost::filesystem;
|
2008-12-26 08:00:21 +01:00
|
|
|
class peer_connection;
|
|
|
|
class upnp;
|
|
|
|
class natpmp;
|
|
|
|
class lsd;
|
2009-04-30 19:30:14 +02:00
|
|
|
struct fingerprint;
|
2009-04-04 09:55:34 +02:00
|
|
|
class torrent;
|
2009-05-03 22:21:24 +02:00
|
|
|
class alert;
|
2008-12-26 08:00:21 +01:00
|
|
|
|
|
|
|
namespace dht
|
|
|
|
{
|
2009-04-30 19:30:14 +02:00
|
|
|
struct dht_tracker;
|
2008-12-26 08:00:21 +01:00
|
|
|
};
|
2007-06-10 22:46:09 +02:00
|
|
|
|
2006-10-11 16:02:21 +02:00
|
|
|
namespace aux
|
|
|
|
{
|
|
|
|
struct session_impl;
|
|
|
|
|
2008-02-17 23:51:03 +01:00
|
|
|
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
2006-11-15 22:39:58 +01:00
|
|
|
struct tracker_logger;
|
|
|
|
#endif
|
|
|
|
|
2006-10-11 16:02:21 +02:00
|
|
|
// this is the link between the main thread and the
|
|
|
|
// thread started to run the main downloader loop
|
|
|
|
struct session_impl: boost::noncopyable
|
|
|
|
{
|
2007-09-29 18:14:03 +02:00
|
|
|
|
|
|
|
// the size of each allocation that is chained in the send buffer
|
2008-12-27 18:00:06 +01:00
|
|
|
enum { send_buffer_size = 128 };
|
2007-09-29 18:14:03 +02:00
|
|
|
|
2008-11-29 22:33:21 +01:00
|
|
|
#ifdef TORRENT_DEBUG
|
2006-10-11 16:02:21 +02:00
|
|
|
friend class ::libtorrent::peer_connection;
|
|
|
|
#endif
|
2007-02-17 02:01:34 +01:00
|
|
|
friend struct checker_impl;
|
2006-10-11 16:02:21 +02:00
|
|
|
friend class invariant_access;
|
2007-10-31 10:48:20 +01:00
|
|
|
typedef std::set<boost::intrusive_ptr<peer_connection> > connection_map;
|
2006-10-11 16:02:21 +02:00
|
|
|
typedef std::map<sha1_hash, boost::shared_ptr<torrent> > torrent_map;
|
|
|
|
|
|
|
|
session_impl(
|
|
|
|
std::pair<int, int> listen_port_range
|
|
|
|
, fingerprint const& cl_fprint
|
2007-11-16 22:21:28 +01:00
|
|
|
, char const* listen_interface
|
2008-02-17 23:51:03 +01:00
|
|
|
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
2007-11-16 22:21:28 +01:00
|
|
|
, fs::path const& logpath
|
|
|
|
#endif
|
|
|
|
);
|
2006-10-11 16:02:21 +02:00
|
|
|
~session_impl();
|
|
|
|
|
2006-11-14 01:08:16 +01:00
|
|
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
2007-10-31 10:48:20 +01:00
|
|
|
void add_extension(boost::function<boost::shared_ptr<torrent_plugin>(
|
|
|
|
torrent*, void*)> ext);
|
2008-01-07 02:10:46 +01:00
|
|
|
#endif
|
2008-11-29 22:33:21 +01:00
|
|
|
#ifdef TORRENT_DEBUG
|
2008-01-07 02:10:46 +01:00
|
|
|
bool has_peer(peer_connection const* p) const
|
|
|
|
{
|
|
|
|
return std::find_if(m_connections.begin(), m_connections.end()
|
|
|
|
, boost::bind(&boost::intrusive_ptr<peer_connection>::get, _1) == p)
|
|
|
|
!= m_connections.end();
|
|
|
|
}
|
2006-11-14 01:08:16 +01:00
|
|
|
#endif
|
2006-10-11 16:02:21 +02:00
|
|
|
void operator()();
|
|
|
|
|
2008-01-07 02:10:46 +01:00
|
|
|
void open_listen_port();
|
2006-10-11 16:02:21 +02:00
|
|
|
|
2007-09-22 18:27:29 +02:00
|
|
|
// if we are listening on an IPv6 interface
|
|
|
|
// this will return one of the IPv6 addresses on this
|
|
|
|
// machine, otherwise just an empty endpoint
|
|
|
|
tcp::endpoint get_ipv6_interface() const;
|
2009-04-12 02:37:06 +02:00
|
|
|
tcp::endpoint get_ipv4_interface() const;
|
2007-09-22 18:27:29 +02:00
|
|
|
|
|
|
|
void async_accept(boost::shared_ptr<socket_acceptor> const& listener);
|
2009-04-09 03:04:49 +02:00
|
|
|
void on_accept_connection(boost::shared_ptr<socket_type> const& s
|
2008-05-03 18:05:42 +02:00
|
|
|
, boost::weak_ptr<socket_acceptor> listener, error_code const& e);
|
2009-04-09 03:04:49 +02:00
|
|
|
void on_socks_accept(boost::shared_ptr<socket_type> const& s
|
|
|
|
, error_code const& e);
|
|
|
|
|
|
|
|
void incoming_connection(boost::shared_ptr<socket_type> const& s);
|
2006-10-11 16:02:21 +02:00
|
|
|
|
|
|
|
// must be locked to access the data
|
|
|
|
// in this struct
|
2009-05-23 23:36:09 +02:00
|
|
|
typedef boost::mutex mutex_t;
|
2006-10-11 16:02:21 +02:00
|
|
|
mutable mutex_t m_mutex;
|
|
|
|
|
|
|
|
boost::weak_ptr<torrent> find_torrent(const sha1_hash& info_hash);
|
|
|
|
peer_id const& get_peer_id() const { return m_peer_id; }
|
|
|
|
|
2008-01-07 02:10:46 +01:00
|
|
|
void close_connection(peer_connection const* p
|
|
|
|
, char const* message);
|
2006-10-11 16:02:21 +02:00
|
|
|
|
|
|
|
void set_settings(session_settings const& s);
|
|
|
|
session_settings const& settings() const { return m_settings; }
|
|
|
|
|
|
|
|
#ifndef TORRENT_DISABLE_DHT
|
|
|
|
void add_dht_node(std::pair<std::string, int> const& node);
|
|
|
|
void add_dht_node(udp::endpoint n);
|
|
|
|
void add_dht_router(std::pair<std::string, int> const& node);
|
|
|
|
void set_dht_settings(dht_settings const& s);
|
2007-03-15 23:03:56 +01:00
|
|
|
dht_settings const& get_dht_settings() const { return m_dht_settings; }
|
2006-10-11 16:02:21 +02:00
|
|
|
void start_dht(entry const& startup_state);
|
|
|
|
void stop_dht();
|
2009-01-23 17:40:00 +01:00
|
|
|
|
2009-05-23 23:36:09 +02:00
|
|
|
entry dht_state(session_impl::mutex_t::scoped_lock& l) const;
|
2008-11-16 03:11:04 +01:00
|
|
|
void maybe_update_udp_mapping(int nat, int local_port, int external_port);
|
2006-10-11 16:02:21 +02:00
|
|
|
#endif
|
2007-03-15 23:03:56 +01:00
|
|
|
|
2007-06-06 02:41:20 +02:00
|
|
|
#ifndef TORRENT_DISABLE_ENCRYPTION
|
|
|
|
void set_pe_settings(pe_settings const& settings);
|
|
|
|
pe_settings const& get_pe_settings() const { return m_pe_settings; }
|
|
|
|
#endif
|
|
|
|
|
2007-03-15 23:03:56 +01:00
|
|
|
// called when a port mapping is successful, or a router returns
|
|
|
|
// a failure to map a port
|
2008-04-06 21:17:58 +02:00
|
|
|
void on_port_mapping(int mapping, int port, std::string const& errmsg
|
|
|
|
, int nat_transport);
|
2007-03-15 23:03:56 +01:00
|
|
|
|
2006-10-11 16:02:21 +02:00
|
|
|
bool is_aborted() const { return m_abort; }
|
2008-06-29 21:08:30 +02:00
|
|
|
bool is_paused() const { return m_paused; }
|
|
|
|
|
|
|
|
void pause();
|
|
|
|
void resume();
|
2006-10-11 16:02:21 +02:00
|
|
|
|
|
|
|
void set_ip_filter(ip_filter const& f);
|
2007-06-01 03:05:57 +02:00
|
|
|
void set_port_filter(port_filter const& f);
|
2006-10-11 16:02:21 +02:00
|
|
|
|
|
|
|
bool listen_on(
|
|
|
|
std::pair<int, int> const& port_range
|
|
|
|
, const char* net_interface = 0);
|
|
|
|
bool is_listening() const;
|
|
|
|
|
2009-02-23 02:21:19 +01:00
|
|
|
torrent_handle add_torrent(add_torrent_params const&, error_code& ec);
|
2006-10-11 16:02:21 +02:00
|
|
|
|
2007-10-13 05:33:33 +02:00
|
|
|
void remove_torrent(torrent_handle const& h, int options);
|
2006-10-11 16:02:21 +02:00
|
|
|
|
|
|
|
std::vector<torrent_handle> get_torrents();
|
|
|
|
|
2008-03-08 07:06:31 +01:00
|
|
|
void check_torrent(boost::shared_ptr<torrent> const& t);
|
|
|
|
void done_checking(boost::shared_ptr<torrent> const& t);
|
|
|
|
|
2008-07-06 14:22:56 +02:00
|
|
|
void set_alert_mask(int m);
|
2008-10-07 07:46:42 +02:00
|
|
|
size_t set_alert_queue_size_limit(size_t queue_size_limit_);
|
2006-10-11 16:02:21 +02:00
|
|
|
std::auto_ptr<alert> pop_alert();
|
2008-12-15 08:12:08 +01:00
|
|
|
void set_alert_dispatch(boost::function<void(alert const&)> const&);
|
2007-01-02 00:51:24 +01:00
|
|
|
|
2007-11-25 09:18:57 +01:00
|
|
|
alert const* wait_for_alert(time_duration max_wait);
|
|
|
|
|
2007-01-02 00:51:24 +01:00
|
|
|
int upload_rate_limit() const;
|
|
|
|
int download_rate_limit() const;
|
2009-05-14 19:21:19 +02:00
|
|
|
int local_upload_rate_limit() const;
|
|
|
|
int local_download_rate_limit() const;
|
|
|
|
|
|
|
|
void set_local_download_rate_limit(int bytes_per_second);
|
|
|
|
void set_local_upload_rate_limit(int bytes_per_second);
|
2007-01-02 00:51:24 +01:00
|
|
|
|
2006-10-11 16:02:21 +02:00
|
|
|
void set_download_rate_limit(int bytes_per_second);
|
|
|
|
void set_upload_rate_limit(int bytes_per_second);
|
|
|
|
void set_max_half_open_connections(int limit);
|
|
|
|
void set_max_connections(int limit);
|
|
|
|
void set_max_uploads(int limit);
|
|
|
|
|
2007-08-16 14:41:46 +02:00
|
|
|
int max_connections() const { return m_max_connections; }
|
|
|
|
int max_uploads() const { return m_max_uploads; }
|
2007-09-10 03:57:40 +02:00
|
|
|
int max_half_open_connections() const { return m_half_open.limit(); }
|
2007-08-16 14:41:46 +02:00
|
|
|
|
|
|
|
int num_uploads() const { return m_num_unchoked; }
|
|
|
|
int num_connections() const
|
|
|
|
{ return m_connections.size(); }
|
|
|
|
|
2008-12-26 08:00:21 +01:00
|
|
|
void unchoke_peer(peer_connection& c);
|
2006-10-11 16:02:21 +02:00
|
|
|
|
|
|
|
session_status status() const;
|
|
|
|
void set_peer_id(peer_id const& id);
|
|
|
|
void set_key(int key);
|
|
|
|
unsigned short listen_port() const;
|
|
|
|
|
|
|
|
void abort();
|
|
|
|
|
2006-11-14 01:08:16 +01:00
|
|
|
torrent_handle find_torrent_handle(sha1_hash const& info_hash);
|
|
|
|
|
2007-04-04 04:06:07 +02:00
|
|
|
void announce_lsd(sha1_hash const& ih);
|
2007-04-25 20:26:35 +02:00
|
|
|
|
|
|
|
void set_peer_proxy(proxy_settings const& s)
|
2009-04-09 03:04:49 +02:00
|
|
|
{
|
|
|
|
m_peer_proxy = s;
|
|
|
|
// in case we just set a socks proxy, we might have to
|
|
|
|
// open the socks incoming connection
|
|
|
|
if (!m_socks_listen_socket) open_new_incoming_socks_connection();
|
|
|
|
}
|
2007-04-25 20:26:35 +02:00
|
|
|
void set_web_seed_proxy(proxy_settings const& s)
|
|
|
|
{ m_web_seed_proxy = s; }
|
|
|
|
void set_tracker_proxy(proxy_settings const& s)
|
|
|
|
{ m_tracker_proxy = s; }
|
|
|
|
|
|
|
|
proxy_settings const& peer_proxy() const
|
|
|
|
{ return m_peer_proxy; }
|
|
|
|
proxy_settings const& web_seed_proxy() const
|
|
|
|
{ return m_web_seed_proxy; }
|
|
|
|
proxy_settings const& tracker_proxy() const
|
|
|
|
{ return m_tracker_proxy; }
|
|
|
|
|
|
|
|
#ifndef TORRENT_DISABLE_DHT
|
|
|
|
void set_dht_proxy(proxy_settings const& s)
|
2007-12-09 05:15:24 +01:00
|
|
|
{
|
|
|
|
m_dht_proxy = s;
|
|
|
|
m_dht_socket.set_proxy_settings(s);
|
|
|
|
}
|
2007-04-25 20:26:35 +02:00
|
|
|
proxy_settings const& dht_proxy() const
|
|
|
|
{ return m_dht_proxy; }
|
|
|
|
#endif
|
|
|
|
|
2008-04-05 06:53:22 +02:00
|
|
|
#ifndef TORRENT_DISABLE_GEO_IP
|
|
|
|
std::string as_name_for_ip(address const& a);
|
|
|
|
int as_for_ip(address const& a);
|
|
|
|
std::pair<const int, int>* lookup_as(int as);
|
|
|
|
bool load_asnum_db(char const* file);
|
2008-04-11 10:46:43 +02:00
|
|
|
bool has_asnum_db() const { return m_asnum_db; }
|
|
|
|
|
|
|
|
bool load_country_db(char const* file);
|
|
|
|
bool has_country_db() const { return m_country_db; }
|
|
|
|
char const* country_for_ip(address const& a);
|
2009-03-31 10:12:35 +02:00
|
|
|
|
|
|
|
#ifndef BOOST_FILESYSTEM_NARROW_ONLY
|
|
|
|
bool load_asnum_db(wchar_t const* file);
|
|
|
|
bool load_country_db(wchar_t const* file);
|
|
|
|
#endif
|
2008-04-05 06:53:22 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
void load_state(entry const& ses_state);
|
|
|
|
entry state() const;
|
|
|
|
|
2007-05-31 02:21:54 +02:00
|
|
|
void start_lsd();
|
2008-04-07 01:18:35 +02:00
|
|
|
natpmp* start_natpmp();
|
|
|
|
upnp* start_upnp();
|
2007-05-31 02:21:54 +02:00
|
|
|
|
|
|
|
void stop_lsd();
|
|
|
|
void stop_natpmp();
|
|
|
|
void stop_upnp();
|
|
|
|
|
2008-02-28 08:34:07 +01:00
|
|
|
int next_port();
|
|
|
|
|
2008-07-11 09:30:04 +02:00
|
|
|
void add_redundant_bytes(size_type b)
|
|
|
|
{
|
|
|
|
TORRENT_ASSERT(b > 0);
|
|
|
|
m_total_redundant_bytes += b;
|
|
|
|
}
|
|
|
|
|
|
|
|
void add_failed_bytes(size_type b)
|
|
|
|
{
|
|
|
|
TORRENT_ASSERT(b > 0);
|
|
|
|
m_total_failed_bytes += b;
|
|
|
|
}
|
|
|
|
|
2007-09-29 18:14:03 +02:00
|
|
|
std::pair<char*, int> allocate_buffer(int size);
|
|
|
|
void free_buffer(char* buf, int size);
|
2008-04-10 12:03:23 +02:00
|
|
|
|
2009-01-23 10:13:31 +01:00
|
|
|
char* allocate_disk_buffer(char const* category);
|
2007-09-29 18:14:03 +02:00
|
|
|
void free_disk_buffer(char* buf);
|
2008-03-29 23:45:55 +01:00
|
|
|
|
|
|
|
void set_external_address(address const& ip);
|
|
|
|
address const& external_address() const { return m_external_address; }
|
2008-02-28 04:09:34 +01:00
|
|
|
|
2006-10-11 16:02:21 +02:00
|
|
|
// private:
|
|
|
|
|
2009-05-23 23:36:09 +02:00
|
|
|
void on_dht_state_callback(boost::condition& c
|
2009-01-23 17:40:00 +01:00
|
|
|
, entry& e, bool& done) const;
|
2007-04-04 04:06:07 +02:00
|
|
|
void on_lsd_peer(tcp::endpoint peer, sha1_hash const& ih);
|
2009-05-01 06:59:15 +02:00
|
|
|
void setup_socket_buffers(socket_type& s);
|
2007-04-04 04:06:07 +02:00
|
|
|
|
2009-05-07 00:36:24 +02:00
|
|
|
// this is a shared pool where policy_peer objects
|
|
|
|
// are allocated. It's a pool since we're likely
|
|
|
|
// to have tens of thousands of peers, and a pool
|
|
|
|
// saves significant overhead
|
2009-05-07 22:30:20 +02:00
|
|
|
#ifdef TORRENT_STATS
|
|
|
|
struct logging_allocator
|
|
|
|
{
|
|
|
|
typedef std::size_t size_type;
|
|
|
|
typedef std::ptrdiff_t difference_type;
|
|
|
|
|
|
|
|
static char* malloc(const size_type bytes)
|
|
|
|
{
|
|
|
|
allocated_bytes += bytes;
|
|
|
|
++allocations;
|
|
|
|
return (char*)::malloc(bytes);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void free(char* const block)
|
|
|
|
{
|
|
|
|
--allocations;
|
|
|
|
return ::free(block);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int allocations;
|
|
|
|
static int allocated_bytes;
|
|
|
|
};
|
2009-05-24 23:49:19 +02:00
|
|
|
boost::object_pool<
|
|
|
|
policy::ipv4_peer, logging_allocator> m_ipv4_peer_pool;
|
|
|
|
# if TORRENT_USE_IPV6
|
|
|
|
boost::object_pool<
|
|
|
|
policy::ipv6_peer, logging_allocator> m_ipv6_peer_pool;
|
|
|
|
# endif
|
2009-05-07 22:30:20 +02:00
|
|
|
#else
|
2009-05-24 23:49:19 +02:00
|
|
|
boost::object_pool<policy::ipv4_peer> m_ipv4_peer_pool;
|
|
|
|
# if TORRENT_USE_IPV6
|
|
|
|
boost::object_pool<policy::ipv6_peer> m_ipv6_peer_pool;
|
|
|
|
# endif
|
2009-05-07 22:30:20 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// this vector is used to store the block_info
|
|
|
|
// objects pointed to by partial_piece_info returned
|
|
|
|
// by torrent::get_download_queue.
|
|
|
|
std::vector<block_info> m_block_info_storage;
|
2009-05-07 00:36:24 +02:00
|
|
|
|
2008-04-09 07:19:11 +02:00
|
|
|
#ifndef TORRENT_DISABLE_POOL_ALLOCATOR
|
2007-09-29 18:14:03 +02:00
|
|
|
// this pool is used to allocate and recycle send
|
|
|
|
// buffers from.
|
|
|
|
boost::pool<> m_send_buffers;
|
2008-04-09 07:19:11 +02:00
|
|
|
#endif
|
2007-12-27 22:43:11 +01:00
|
|
|
boost::mutex m_send_buffer_mutex;
|
2007-09-29 18:14:03 +02:00
|
|
|
|
2007-05-12 01:41:31 +02:00
|
|
|
// the file pool that all storages in this session's
|
|
|
|
// torrents uses. It sets a limit on the number of
|
|
|
|
// open files by this session.
|
|
|
|
// file pool must be destructed after the torrents
|
|
|
|
// since they will still have references to it
|
|
|
|
// when they are destructed.
|
|
|
|
file_pool m_files;
|
|
|
|
|
2008-02-08 11:22:05 +01:00
|
|
|
// this is where all active sockets are stored.
|
|
|
|
// the selector can sleep while there's no activity on
|
|
|
|
// them
|
2009-01-23 17:40:00 +01:00
|
|
|
mutable io_service m_io_service;
|
2008-02-08 11:22:05 +01:00
|
|
|
|
2009-05-23 23:36:09 +02:00
|
|
|
// handles delayed alerts
|
|
|
|
alert_manager m_alerts;
|
|
|
|
|
2007-10-10 00:17:16 +02:00
|
|
|
// handles disk io requests asynchronously
|
|
|
|
// peers have pointers into the disk buffer
|
|
|
|
// pool, and must be destructed before this
|
2007-10-31 10:48:20 +01:00
|
|
|
// object. The disk thread relies on the file
|
|
|
|
// pool object, and must be destructed before
|
2008-02-08 11:22:05 +01:00
|
|
|
// m_files. The disk io thread posts completion
|
|
|
|
// events to the io service, and needs to be
|
|
|
|
// constructed after it.
|
2007-10-10 00:17:16 +02:00
|
|
|
disk_io_thread m_disk_thread;
|
|
|
|
|
2007-05-24 20:53:55 +02:00
|
|
|
// this is a list of half-open tcp connections
|
|
|
|
// (only outgoing connections)
|
|
|
|
// this has to be one of the last
|
|
|
|
// members to be destructed
|
|
|
|
connection_queue m_half_open;
|
|
|
|
|
2007-01-10 16:02:25 +01:00
|
|
|
// the bandwidth manager is responsible for
|
|
|
|
// handing out bandwidth to connections that
|
|
|
|
// asks for it, it can also throttle the
|
|
|
|
// rate.
|
2009-04-26 02:21:59 +02:00
|
|
|
bandwidth_manager<peer_connection> m_download_rate;
|
|
|
|
bandwidth_manager<peer_connection> m_upload_rate;
|
2007-07-03 01:48:06 +02:00
|
|
|
|
2009-05-14 19:21:19 +02:00
|
|
|
// the global rate limiter bandwidth channels
|
2009-04-26 02:21:59 +02:00
|
|
|
bandwidth_channel m_download_channel;
|
|
|
|
bandwidth_channel m_upload_channel;
|
|
|
|
|
2009-05-14 19:21:19 +02:00
|
|
|
// bandwidth channels for local peers when
|
|
|
|
// rate limits are ignored. They are only
|
|
|
|
// throttled by these global rate limiters
|
|
|
|
// and they don't have a rate limit set by
|
|
|
|
// default
|
|
|
|
bandwidth_channel m_local_download_channel;
|
|
|
|
bandwidth_channel m_local_upload_channel;
|
|
|
|
|
2009-04-26 02:21:59 +02:00
|
|
|
bandwidth_channel* m_bandwidth_channel[2];
|
2007-01-10 16:02:25 +01:00
|
|
|
|
2006-10-11 16:02:21 +02:00
|
|
|
tracker_manager m_tracker_manager;
|
|
|
|
torrent_map m_torrents;
|
2008-06-12 23:22:24 +02:00
|
|
|
typedef std::list<boost::shared_ptr<torrent> > check_queue_t;
|
|
|
|
check_queue_t m_queued_for_checking;
|
2006-10-11 16:02:21 +02:00
|
|
|
|
|
|
|
// this maps sockets to their peer_connection
|
|
|
|
// object. It is the complete list of all connected
|
|
|
|
// peers.
|
|
|
|
connection_map m_connections;
|
|
|
|
|
|
|
|
// filters incoming connections
|
|
|
|
ip_filter m_ip_filter;
|
2007-06-01 03:05:57 +02:00
|
|
|
|
|
|
|
// filters outgoing connections
|
|
|
|
port_filter m_port_filter;
|
2006-10-11 16:02:21 +02:00
|
|
|
|
|
|
|
// the peer id that is generated at the start of the session
|
|
|
|
peer_id m_peer_id;
|
|
|
|
|
|
|
|
// the key is an id that is used to identify the
|
|
|
|
// client with the tracker only. It is randomized
|
|
|
|
// at startup
|
|
|
|
int m_key;
|
|
|
|
|
2007-09-22 18:27:29 +02:00
|
|
|
// the number of retries we make when binding the
|
|
|
|
// listen socket. For each retry the port number
|
|
|
|
// is incremented by one
|
|
|
|
int m_listen_port_retries;
|
2006-10-11 16:02:21 +02:00
|
|
|
|
|
|
|
// the ip-address of the interface
|
|
|
|
// we are supposed to listen on.
|
|
|
|
// if the ip is set to zero, it means
|
|
|
|
// that we should let the os decide which
|
|
|
|
// interface to listen on
|
|
|
|
tcp::endpoint m_listen_interface;
|
2007-09-22 18:27:29 +02:00
|
|
|
|
|
|
|
// if we're listening on an IPv6 interface
|
|
|
|
// this is one of the non local IPv6 interfaces
|
|
|
|
// on this machine
|
|
|
|
tcp::endpoint m_ipv6_interface;
|
2009-04-12 02:37:06 +02:00
|
|
|
tcp::endpoint m_ipv4_interface;
|
2007-03-15 23:03:56 +01:00
|
|
|
|
2007-09-22 18:27:29 +02:00
|
|
|
struct listen_socket_t
|
|
|
|
{
|
|
|
|
listen_socket_t(): external_port(0) {}
|
|
|
|
// this is typically set to the same as the local
|
|
|
|
// listen port. In case a NAT port forward was
|
|
|
|
// successfully opened, this will be set to the
|
|
|
|
// port that is open on the external (NAT) interface
|
|
|
|
// on the NAT box itself. This is the port that has
|
|
|
|
// to be published to peers, since this is the port
|
|
|
|
// the client is reachable through.
|
|
|
|
int external_port;
|
|
|
|
|
|
|
|
// the actual socket
|
|
|
|
boost::shared_ptr<socket_acceptor> sock;
|
|
|
|
};
|
|
|
|
// since we might be listening on multiple interfaces
|
|
|
|
// we might need more than one listen socket
|
|
|
|
std::list<listen_socket_t> m_listen_sockets;
|
|
|
|
|
2009-04-09 03:04:49 +02:00
|
|
|
// when as a socks proxy is used for peers, also
|
|
|
|
// listen for incoming connections on a socks connection
|
|
|
|
boost::shared_ptr<socket_type> m_socks_listen_socket;
|
|
|
|
|
|
|
|
void open_new_incoming_socks_connection();
|
|
|
|
|
2007-11-23 23:14:33 +01:00
|
|
|
listen_socket_t setup_listener(tcp::endpoint ep, int retries, bool v6_only = false);
|
2006-10-11 16:02:21 +02:00
|
|
|
|
|
|
|
// the settings for the client
|
|
|
|
session_settings m_settings;
|
2007-04-25 20:26:35 +02:00
|
|
|
// the proxy settings for different
|
|
|
|
// kinds of connections
|
|
|
|
proxy_settings m_peer_proxy;
|
|
|
|
proxy_settings m_web_seed_proxy;
|
|
|
|
proxy_settings m_tracker_proxy;
|
|
|
|
#ifndef TORRENT_DISABLE_DHT
|
|
|
|
proxy_settings m_dht_proxy;
|
|
|
|
#endif
|
2006-10-11 16:02:21 +02:00
|
|
|
|
|
|
|
// set to true when the session object
|
|
|
|
// is being destructed and the thread
|
|
|
|
// should exit
|
|
|
|
volatile bool m_abort;
|
|
|
|
|
2008-06-29 21:08:30 +02:00
|
|
|
// is true if the session is paused
|
|
|
|
bool m_paused;
|
|
|
|
|
2008-01-13 12:18:18 +01:00
|
|
|
// the max number of unchoked peers as set by the user
|
2006-10-11 16:02:21 +02:00
|
|
|
int m_max_uploads;
|
2008-01-13 12:18:18 +01:00
|
|
|
|
|
|
|
// the number of unchoked peers as set by the auto-unchoker
|
|
|
|
// this should always be >= m_max_uploads
|
|
|
|
int m_allowed_upload_slots;
|
|
|
|
|
|
|
|
// the max number of connections, as set by the user
|
2006-10-11 16:02:21 +02:00
|
|
|
int m_max_connections;
|
|
|
|
|
2007-08-16 14:41:46 +02:00
|
|
|
// the number of unchoked peers
|
|
|
|
int m_num_unchoked;
|
|
|
|
|
|
|
|
// this is initialized to the unchoke_interval
|
|
|
|
// session_setting and decreased every second.
|
|
|
|
// when it reaches zero, it is reset to the
|
|
|
|
// unchoke_interval and the unchoke set is
|
|
|
|
// recomputed.
|
|
|
|
int m_unchoke_time_scaler;
|
|
|
|
|
2008-04-24 05:28:48 +02:00
|
|
|
// this is used to decide when to recalculate which
|
|
|
|
// torrents to keep queued and which to activate
|
|
|
|
int m_auto_manage_time_scaler;
|
|
|
|
|
2007-08-16 14:41:46 +02:00
|
|
|
// works like unchoke_time_scaler but it
|
|
|
|
// is only decresed when the unchoke set
|
|
|
|
// is recomputed, and when it reaches zero,
|
|
|
|
// the optimistic unchoke is moved to another peer.
|
|
|
|
int m_optimistic_unchoke_time_scaler;
|
|
|
|
|
|
|
|
// works like unchoke_time_scaler. Each time
|
|
|
|
// it reaches 0, and all the connections are
|
|
|
|
// used, the worst connection will be disconnected
|
|
|
|
// from the torrent with the most peers
|
|
|
|
int m_disconnect_time_scaler;
|
|
|
|
|
2008-05-19 06:06:25 +02:00
|
|
|
// when this scaler reaches zero, it will
|
|
|
|
// scrape one of the auto managed, paused,
|
|
|
|
// torrents.
|
|
|
|
int m_auto_scrape_time_scaler;
|
|
|
|
|
2006-10-11 16:02:21 +02:00
|
|
|
// statistics gathered from all torrents.
|
|
|
|
stat m_stat;
|
|
|
|
|
|
|
|
// is false by default and set to true when
|
|
|
|
// the first incoming connection is established
|
|
|
|
// this is used to know if the client is behind
|
|
|
|
// NAT or not.
|
|
|
|
bool m_incoming_connection;
|
2006-11-14 16:53:38 +01:00
|
|
|
|
2009-06-10 10:30:55 +02:00
|
|
|
void on_disk_queue();
|
2009-04-26 02:21:59 +02:00
|
|
|
void on_tick(error_code const& e);
|
|
|
|
|
2009-05-27 21:27:12 +02:00
|
|
|
int auto_manage_torrents(std::vector<torrent*>& list
|
|
|
|
, int hard_limit, int type_limit);
|
2008-04-24 05:28:48 +02:00
|
|
|
void recalculate_auto_managed_torrents();
|
|
|
|
void recalculate_unchoke_slots(int congested_torrents
|
|
|
|
, int uncongested_torrents);
|
2008-10-19 00:35:10 +02:00
|
|
|
void recalculate_optimistic_unchoke_slot();
|
2008-04-24 05:28:48 +02:00
|
|
|
|
2009-04-30 07:49:46 +02:00
|
|
|
ptime m_created;
|
|
|
|
int session_time() const { return total_seconds(time_now() - m_created); }
|
|
|
|
|
2007-04-05 00:27:36 +02:00
|
|
|
ptime m_last_tick;
|
2009-04-26 02:21:59 +02:00
|
|
|
ptime m_last_second_tick;
|
2006-10-11 16:02:21 +02:00
|
|
|
|
2009-04-04 09:55:34 +02:00
|
|
|
// the last time we went through the peers
|
|
|
|
// to decide which ones to choke/unchoke
|
|
|
|
ptime m_last_choke;
|
|
|
|
|
2008-02-28 08:34:07 +01:00
|
|
|
// when outgoing_ports is configured, this is the
|
|
|
|
// port we'll bind the next outgoing socket to
|
|
|
|
int m_next_port;
|
|
|
|
|
2006-10-11 16:02:21 +02:00
|
|
|
#ifndef TORRENT_DISABLE_DHT
|
2007-03-02 02:16:59 +01:00
|
|
|
boost::intrusive_ptr<dht::dht_tracker> m_dht;
|
2006-10-11 16:02:21 +02:00
|
|
|
dht_settings m_dht_settings;
|
2007-03-15 23:03:56 +01:00
|
|
|
// if this is set to true, the dht listen port
|
|
|
|
// will be set to the same as the tcp listen port
|
|
|
|
// and will be synchronlized with it as it changes
|
|
|
|
// it defaults to true
|
|
|
|
bool m_dht_same_port;
|
|
|
|
|
|
|
|
// see m_external_listen_port. This is the same
|
|
|
|
// but for the udp port used by the DHT.
|
|
|
|
int m_external_udp_port;
|
2007-12-09 05:15:24 +01:00
|
|
|
|
2008-11-08 18:40:06 +01:00
|
|
|
rate_limited_udp_socket m_dht_socket;
|
2007-12-09 05:15:24 +01:00
|
|
|
|
2008-09-02 08:37:40 +02:00
|
|
|
// these are used when starting the DHT
|
|
|
|
// (and bootstrapping it), and then erased
|
|
|
|
std::list<std::pair<std::string, int> > m_dht_router_nodes;
|
|
|
|
|
2008-05-03 18:05:42 +02:00
|
|
|
void on_receive_udp(error_code const& e
|
2008-03-25 05:46:18 +01:00
|
|
|
, udp::endpoint const& ep, char const* buf, int len);
|
2006-10-11 16:02:21 +02:00
|
|
|
#endif
|
2007-06-06 02:41:20 +02:00
|
|
|
|
|
|
|
#ifndef TORRENT_DISABLE_ENCRYPTION
|
|
|
|
pe_settings m_pe_settings;
|
|
|
|
#endif
|
|
|
|
|
2007-09-29 23:31:51 +02:00
|
|
|
boost::intrusive_ptr<natpmp> m_natpmp;
|
|
|
|
boost::intrusive_ptr<upnp> m_upnp;
|
|
|
|
boost::intrusive_ptr<lsd> m_lsd;
|
2007-03-15 23:03:56 +01:00
|
|
|
|
2008-04-06 21:17:58 +02:00
|
|
|
// 0 is natpmp 1 is upnp
|
|
|
|
int m_tcp_mapping[2];
|
|
|
|
int m_udp_mapping[2];
|
|
|
|
|
2009-04-26 02:21:59 +02:00
|
|
|
// the timer used to fire the tick
|
2006-10-11 16:02:21 +02:00
|
|
|
deadline_timer m_timer;
|
2007-05-05 02:29:33 +02:00
|
|
|
|
|
|
|
// the index of the torrent that will be offered to
|
2009-04-26 02:21:59 +02:00
|
|
|
// connect to a peer next time on_tick is called.
|
2007-05-05 02:29:33 +02:00
|
|
|
// This implements a round robin.
|
|
|
|
int m_next_connect_torrent;
|
2008-11-29 22:33:21 +01:00
|
|
|
#ifdef TORRENT_DEBUG
|
2007-08-21 20:33:28 +02:00
|
|
|
void check_invariant() const;
|
2006-10-11 16:02:21 +02:00
|
|
|
#endif
|
2007-05-14 00:01:21 +02:00
|
|
|
|
|
|
|
#ifdef TORRENT_STATS
|
2008-12-26 08:00:21 +01:00
|
|
|
void log_buffer_usage();
|
|
|
|
|
2007-05-14 00:01:21 +02:00
|
|
|
// logger used to write bandwidth usage statistics
|
|
|
|
std::ofstream m_stats_logger;
|
|
|
|
int m_second_counter;
|
2007-09-29 18:14:03 +02:00
|
|
|
// used to log send buffer usage statistics
|
|
|
|
std::ofstream m_buffer_usage_logger;
|
|
|
|
// the number of send buffers that are allocated
|
|
|
|
int m_buffer_allocations;
|
2007-05-14 00:01:21 +02:00
|
|
|
#endif
|
2008-02-17 23:51:03 +01:00
|
|
|
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
2006-11-30 12:56:19 +01:00
|
|
|
boost::shared_ptr<logger> create_log(std::string const& name
|
|
|
|
, int instance, bool append = true);
|
2006-11-15 22:39:58 +01:00
|
|
|
|
|
|
|
// this list of tracker loggers serves as tracker_callbacks when
|
|
|
|
// shutting down. This list is just here to keep them alive during
|
|
|
|
// whe shutting down process
|
|
|
|
std::list<boost::shared_ptr<tracker_logger> > m_tracker_loggers;
|
2007-05-05 02:29:33 +02:00
|
|
|
|
2007-11-16 22:21:28 +01:00
|
|
|
fs::path m_logpath;
|
2006-10-11 16:02:21 +02:00
|
|
|
public:
|
|
|
|
boost::shared_ptr<logger> m_logger;
|
|
|
|
private:
|
2008-03-29 23:45:55 +01:00
|
|
|
|
2008-10-22 03:12:14 +02:00
|
|
|
#endif
|
|
|
|
#ifdef TORRENT_UPNP_LOGGING
|
|
|
|
std::ofstream m_upnp_log;
|
2006-10-11 16:02:21 +02:00
|
|
|
#endif
|
2008-03-29 23:45:55 +01:00
|
|
|
address m_external_address;
|
2006-10-11 16:02:21 +02:00
|
|
|
|
2006-11-14 01:08:16 +01:00
|
|
|
#ifndef TORRENT_DISABLE_EXTENSIONS
|
|
|
|
typedef std::list<boost::function<boost::shared_ptr<
|
2007-09-14 02:11:33 +02:00
|
|
|
torrent_plugin>(torrent*, void*)> > extension_list_t;
|
2006-11-14 01:08:16 +01:00
|
|
|
|
|
|
|
extension_list_t m_extensions;
|
|
|
|
#endif
|
|
|
|
|
2008-04-05 06:53:22 +02:00
|
|
|
#ifndef TORRENT_DISABLE_GEO_IP
|
2008-04-11 10:46:43 +02:00
|
|
|
GeoIP* m_asnum_db;
|
|
|
|
GeoIP* m_country_db;
|
2008-04-05 06:53:22 +02:00
|
|
|
|
|
|
|
// maps AS number to the peak download rate
|
|
|
|
// we've seen from it. Entries are never removed
|
|
|
|
// from this map. Pointers to its elements
|
|
|
|
// are kept in the policy::peer structures.
|
|
|
|
std::map<int, int> m_as_peak;
|
|
|
|
#endif
|
|
|
|
|
2008-07-11 09:30:04 +02:00
|
|
|
// total redundant and failed bytes
|
|
|
|
size_type m_total_failed_bytes;
|
|
|
|
size_type m_total_redundant_bytes;
|
|
|
|
|
2006-10-11 16:02:21 +02:00
|
|
|
// the main working thread
|
|
|
|
boost::scoped_ptr<boost::thread> m_thread;
|
|
|
|
};
|
2006-11-15 22:39:58 +01:00
|
|
|
|
2008-02-17 23:51:03 +01:00
|
|
|
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
2006-11-15 22:39:58 +01:00
|
|
|
struct tracker_logger : request_callback
|
|
|
|
{
|
|
|
|
tracker_logger(session_impl& ses): m_ses(ses) {}
|
2008-04-24 03:35:48 +02:00
|
|
|
void tracker_warning(tracker_request const& req
|
|
|
|
, std::string const& str)
|
2006-11-15 22:39:58 +01:00
|
|
|
{
|
|
|
|
debug_log("*** tracker warning: " + str);
|
|
|
|
}
|
|
|
|
|
|
|
|
void tracker_response(tracker_request const&
|
2008-12-02 09:29:45 +01:00
|
|
|
, libtorrent::address const& tracker_ip
|
2009-05-15 23:23:41 +02:00
|
|
|
, std::list<address> const& ip_list
|
2006-11-15 22:39:58 +01:00
|
|
|
, std::vector<peer_entry>& peers
|
|
|
|
, int interval
|
|
|
|
, int complete
|
2008-03-30 20:31:30 +02:00
|
|
|
, int incomplete
|
|
|
|
, address const& external_ip)
|
2006-11-15 22:39:58 +01:00
|
|
|
{
|
2009-04-04 11:52:25 +02:00
|
|
|
std::string s;
|
|
|
|
s = "TRACKER RESPONSE:\n";
|
|
|
|
char tmp[200];
|
|
|
|
snprintf(tmp, 200, "interval: %d\npeers:\n", interval);
|
|
|
|
s += tmp;
|
2006-11-15 22:39:58 +01:00
|
|
|
for (std::vector<peer_entry>::const_iterator i = peers.begin();
|
|
|
|
i != peers.end(); ++i)
|
|
|
|
{
|
2009-04-04 11:52:25 +02:00
|
|
|
char pid[41];
|
|
|
|
to_hex((const char*)&i->pid[0], 20, pid);
|
|
|
|
if (i->pid.is_all_zeros()) pid[0] = 0;
|
|
|
|
|
2009-05-15 23:23:41 +02:00
|
|
|
snprintf(tmp, 200, " %-16s %-5d %s\n", i->ip.c_str(), i->port, pid);
|
2009-04-04 11:52:25 +02:00
|
|
|
s += tmp;
|
2006-11-15 22:39:58 +01:00
|
|
|
}
|
2009-04-04 11:52:25 +02:00
|
|
|
snprintf(tmp, 200, "external ip: %s\n", print_address(external_ip).c_str());
|
|
|
|
s += tmp;
|
|
|
|
debug_log(s);
|
2006-11-15 22:39:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void tracker_request_timed_out(
|
|
|
|
tracker_request const&)
|
|
|
|
{
|
|
|
|
debug_log("*** tracker timed out");
|
|
|
|
}
|
|
|
|
|
|
|
|
void tracker_request_error(
|
|
|
|
tracker_request const&
|
|
|
|
, int response_code
|
|
|
|
, const std::string& str)
|
|
|
|
{
|
|
|
|
debug_log(std::string("*** tracker error: ")
|
|
|
|
+ boost::lexical_cast<std::string>(response_code) + ": "
|
|
|
|
+ str);
|
|
|
|
}
|
|
|
|
|
|
|
|
void debug_log(const std::string& line)
|
|
|
|
{
|
2007-10-26 09:14:19 +02:00
|
|
|
(*m_ses.m_logger) << time_now_string() << " " << line << "\n";
|
2006-11-15 22:39:58 +01:00
|
|
|
}
|
|
|
|
session_impl& m_ses;
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2006-10-11 16:02:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|