frostalf / libtorrent

Automatically exported from code.google.com/p/libtorrent
0 stars 0 forks source link

torrent::start_download_url() does not use proxy settings #590

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The call to http_connection.get() in torrent::start_download_url() does not use 
the proxy_settings configured for the session.

Original issue reported on code.google.com by mho...@8thbridge.com on 12 Mar 2014 at 4:10

GoogleCodeExporter commented 9 years ago
thanks for the report! would you mind testing this patch? (it's against the 
RC_0_16 branch, but will probably apply against any recent 0.16.x release):

Index: src/torrent.cpp
===================================================================
--- src/torrent.cpp (revision 9876)
+++ src/torrent.cpp (working copy)
@@ -907,8 +907,17 @@
        boost::shared_ptr<http_connection> conn(
            new http_connection(m_ses.m_io_service, m_ses.m_half_open
                , boost::bind(&torrent::on_torrent_download, shared_from_this()
-                   , _1, _2, _3, _4)));
-       conn->get(m_url, seconds(30), 0, 0, 5, m_ses.m_settings.user_agent);
+                   , _1, _2, _3, _4)
+               , true
+               , http_connect_handler()
+               , http_filter_handler()
+#ifdef TORRENT_USE_OPENSSL
+               , tracker_req().ssl_ctx
+#endif
+               ));
+
+       conn->get(m_url, seconds(30), 0, &m_ses.proxy()
+           , 5, m_ses.m_settings.user_agent);
        set_state(torrent_status::downloading_metadata);
    }

Original comment by arvid.no...@gmail.com on 5 Apr 2014 at 3:18

GoogleCodeExporter commented 9 years ago
obviously I meant this:

Index: src/torrent.cpp
===================================================================
--- src/torrent.cpp (revision 9876)
+++ src/torrent.cpp (working copy)
@@ -907,8 +907,17 @@
        boost::shared_ptr<http_connection> conn(
            new http_connection(m_ses.m_io_service, m_ses.m_half_open
                , boost::bind(&torrent::on_torrent_download, shared_from_this()
-                   , _1, _2, _3, _4)));
-       conn->get(m_url, seconds(30), 0, 0, 5, m_ses.m_settings.user_agent);
+                   , _1, _2, _3, _4)
+               , true
+               , http_connect_handler()
+               , http_filter_handler()
+#ifdef TORRENT_USE_OPENSSL
+               , m_ssl_ctx.get()
+#endif
+               ));
+
+       conn->get(m_url, seconds(30), 0, &m_ses.proxy()
+           , 5, m_ses.m_settings.user_agent);
        set_state(torrent_status::downloading_metadata);
    }

Original comment by arvid.no...@gmail.com on 5 Apr 2014 at 3:30

GoogleCodeExporter commented 9 years ago

Original comment by arvid.no...@gmail.com on 15 Apr 2014 at 5:20