*** empty log message ***

This commit is contained in:
Arvid Norberg 2004-01-14 19:24:11 +00:00
parent 475b0d0a6b
commit f036fc99a4
4 changed files with 31 additions and 2 deletions

View File

@ -294,7 +294,7 @@ int main(int argc, char* argv[])
while (a.get()) while (a.get())
{ {
if (events.size() >= 10) events.pop_front(); if (events.size() >= 10) events.pop_front();
events.push_front(a->msg()); events.push_back(a->msg());
a = ses.pop_alert(); a = ses.pop_alert();
} }

View File

@ -175,7 +175,7 @@ namespace libtorrent
using namespace boost::posix_time; using namespace boost::posix_time;
return p.connection == 0 return p.connection == 0
&& second_clock::local_time() - p.connected > seconds(30*60); && second_clock::local_time() - p.connected > minutes(30);
} }
}; };

View File

@ -60,6 +60,7 @@ namespace libtorrent
#endif #endif
std::string escape_string(const char* str, int len); std::string escape_string(const char* str, int len);
std::string unescape_string(std::string const& s);
struct tracker_alert: alert struct tracker_alert: alert
{ {

View File

@ -180,6 +180,34 @@ namespace
namespace libtorrent namespace libtorrent
{ {
std::string unescape_string(std::string const& s)
{
std::string ret;
for (std::string::const_iterator i = s.begin(); i != s.end(); ++i)
{
if (*i != '%') ret += *i;
else
{
if (i == s.end())
throw std::runtime_error("invalid escaped string");
++i;
int high = *i - '0';
if (i == s.end())
throw std::runtime_error("invalid escaped string");
++i;
int low = *i - '0';
if (high >= 16 || low >= 16 || high < 0 || low < 0)
throw std::runtime_error("invalid escaped string");
ret += char(high * 16 + low);
}
}
return ret;
}
std::string escape_string(const char* str, int len) std::string escape_string(const char* str, int len)
{ {
static const char special_chars[] = "$-_.+!*'(),"; static const char special_chars[] = "$-_.+!*'(),";