added support for http redirection

This commit is contained in:
Arvid Norberg
2004-07-25 20:57:44 +00:00
parent bd296f3657
commit 7f21b35a33
5 changed files with 75 additions and 25 deletions

View File

@@ -95,7 +95,9 @@ namespace libtorrent
assert(len >= 0);
// http://www.ietf.org/rfc/rfc2396.txt
// section 2.3
static const char unreserved_chars[] = "-_.!~*'()";
// some trackers seems to require that ' is escaped
// static const char unreserved_chars[] = "-_.!~*'()";
static const char unreserved_chars[] = "-_.!~*()";
std::stringstream ret;
ret << std::hex << std::setfill('0');
@@ -109,6 +111,10 @@ namespace libtorrent
{
ret << *str;
}
else if (*str == ' ')
{
ret << '+';
}
else
{
ret << '%'