~ubuntu-branches/ubuntu/maverick/libtorrent-rasterbar/maverick

« back to all changes in this revision

Viewing changes to include/libtorrent/http_connection.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Sauthier
  • Date: 2010-08-10 12:59:37 UTC
  • mfrom: (1.3.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20100810125937-jbcmmf17y8yo9hgz
Tags: 0.15.0-0ubuntu1
* New upstream version.
* debian/patches/100_fix_html_docs.patch: refreshed.
* debian/control: bump up standards-version to 3.9.1 (no changes).

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
 
66
66
typedef boost::function<void(http_connection&)> http_connect_handler;
67
67
 
68
 
// TODO: add bind interface
 
68
typedef boost::function<void(http_connection&, std::list<tcp::endpoint>&)> http_filter_handler;
69
69
 
70
70
// when bottled, the last two arguments to the handler
71
71
// will always be 0
72
 
struct http_connection : boost::enable_shared_from_this<http_connection>, boost::noncopyable
 
72
struct TORRENT_EXPORT http_connection : boost::enable_shared_from_this<http_connection>, boost::noncopyable
73
73
{
74
74
        http_connection(io_service& ios, connection_queue& cc
75
75
                , http_handler const& handler, bool bottled = true
76
 
                , http_connect_handler const& ch = http_connect_handler())
 
76
                , http_connect_handler const& ch = http_connect_handler()
 
77
                , http_filter_handler const& fh = http_filter_handler())
77
78
                : m_sock(ios)
78
79
                , m_read_pos(0)
79
80
                , m_resolver(ios)
80
81
                , m_handler(handler)
81
82
                , m_connect_handler(ch)
 
83
                , m_filter_handler(fh)
82
84
                , m_timer(ios)
83
85
                , m_last_receive(time_now())
84
86
                , m_bottled(bottled)
120
122
#else
121
123
        socket_type const& socket() const { return m_sock; }
122
124
#endif
 
125
 
 
126
        std::list<tcp::endpoint> const& endpoints() const { return m_endpoints; }
123
127
        
124
128
private:
125
129
 
148
152
        http_parser m_parser;
149
153
        http_handler m_handler;
150
154
        http_connect_handler m_connect_handler;
 
155
        http_filter_handler m_filter_handler;
151
156
        deadline_timer m_timer;
152
157
        time_duration m_timeout;
153
158
        ptime m_last_receive;