* Allow hex values in the 'tos' option.

* Moved more encryption related code to HandshakeEncryption.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@797 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-10-25 08:24:20 +00:00
parent 2781ce9698
commit 5dfc986658
5 changed files with 29 additions and 11 deletions
+9 -6
View File
@@ -279,25 +279,28 @@ apply_enable_trackers(Control* m, __UNUSED const std::string& arg) {
void
apply_tos(const std::string& arg) {
utils::Variable::value_type value;
torrent::ConnectionManager* cm = torrent::connection_manager();
if (arg == "default")
cm->set_priority(torrent::ConnectionManager::iptos_default);
value = torrent::ConnectionManager::iptos_default;
else if (arg == "lowdelay")
cm->set_priority(torrent::ConnectionManager::iptos_lowdelay);
value = torrent::ConnectionManager::iptos_lowdelay;
else if (arg == "throughput")
cm->set_priority(torrent::ConnectionManager::iptos_throughput);
value = torrent::ConnectionManager::iptos_throughput;
else if (arg == "reliability")
cm->set_priority(torrent::ConnectionManager::iptos_reliability);
value = torrent::ConnectionManager::iptos_reliability;
else if (arg == "mincost")
cm->set_priority(torrent::ConnectionManager::iptos_mincost);
value = torrent::ConnectionManager::iptos_mincost;
else
else if (!utils::Variable::string_to_value_unit_nothrow(arg.c_str(), &value, 16, 0))
throw torrent::input_error("Invalid TOS identifier.");
cm->set_priority(value);
}
void