rollback
This commit is contained in:
@@ -51,7 +51,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "libtorrent/entry.hpp"
|
||||
#include "libtorrent/bencode.hpp"
|
||||
#include "libtorrent/session.hpp"
|
||||
#include "libtorrent/http_proxy.hpp"
|
||||
#include "libtorrent/http_settings.hpp"
|
||||
#include "libtorrent/identify_client.hpp"
|
||||
#include "libtorrent/alert_types.hpp"
|
||||
|
||||
@@ -108,17 +108,17 @@ struct set_keypress
|
||||
{
|
||||
set_keypress()
|
||||
{
|
||||
termios new_http_proxy;
|
||||
tcgetattr(0,&stored_http_proxy);
|
||||
new_http_proxy = stored_http_proxy;
|
||||
termios new_settings;
|
||||
tcgetattr(0,&stored_settings);
|
||||
new_settings = stored_settings;
|
||||
// Disable canonical mode, and set buffer size to 1 byte
|
||||
new_http_proxy.c_lflag &= (~ICANON);
|
||||
new_http_proxy.c_cc[VTIME] = 0;
|
||||
new_http_proxy.c_cc[VMIN] = 1;
|
||||
tcsetattr(0,TCSANOW,&new_http_proxy);
|
||||
new_settings.c_lflag &= (~ICANON);
|
||||
new_settings.c_cc[VTIME] = 0;
|
||||
new_settings.c_cc[VMIN] = 1;
|
||||
tcsetattr(0,TCSANOW,&new_settings);
|
||||
}
|
||||
~set_keypress() { tcsetattr(0,TCSANOW,&stored_http_proxy); }
|
||||
termios stored_http_proxy;
|
||||
~set_keypress() { tcsetattr(0,TCSANOW,&stored_settings); }
|
||||
termios stored_settings;
|
||||
};
|
||||
|
||||
bool sleep_and_input(char* c)
|
||||
@@ -303,12 +303,12 @@ int main(int argc, char* argv[])
|
||||
namespace fs = boost::filesystem;
|
||||
fs::path::default_name_check(fs::no_check);
|
||||
|
||||
http_proxy http_proxy;
|
||||
// http_proxy.proxy_ip = "192.168.0.1";
|
||||
// http_proxy.proxy_port = 80;
|
||||
// http_proxy.proxy_login = "hyd";
|
||||
// http_proxy.proxy_password = "foobar";
|
||||
http_proxy.user_agent = "client_test";
|
||||
http_settings settings;
|
||||
// settings.proxy_ip = "192.168.0.1";
|
||||
// settings.proxy_port = 80;
|
||||
// settings.proxy_login = "hyd";
|
||||
// settings.proxy_password = "foobar";
|
||||
settings.user_agent = "client_test";
|
||||
|
||||
std::deque<std::string> events;
|
||||
|
||||
@@ -319,7 +319,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
ses.listen_on(std::make_pair(6880, 6889));
|
||||
//ses.set_upload_rate_limit(512 * 1024);
|
||||
ses.set_http_proxy(http_proxy);
|
||||
ses.set_http_settings(settings);
|
||||
ses.set_severity_level(alert::debug);
|
||||
// ses.set_severity_level(alert::info);
|
||||
|
||||
|
@@ -41,7 +41,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "libtorrent/entry.hpp"
|
||||
#include "libtorrent/bencode.hpp"
|
||||
#include "libtorrent/session.hpp"
|
||||
#include "libtorrent/http_proxy.hpp"
|
||||
#include "libtorrent/http_settings.hpp"
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
Reference in New Issue
Block a user