forked from premiere/premiere-libtorrent
*** empty log message ***
This commit is contained in:
parent
475b0d0a6b
commit
f036fc99a4
|
@ -294,7 +294,7 @@ int main(int argc, char* argv[])
|
|||
while (a.get())
|
||||
{
|
||||
if (events.size() >= 10) events.pop_front();
|
||||
events.push_front(a->msg());
|
||||
events.push_back(a->msg());
|
||||
a = ses.pop_alert();
|
||||
}
|
||||
|
||||
|
|
|
@ -175,7 +175,7 @@ namespace libtorrent
|
|||
using namespace boost::posix_time;
|
||||
|
||||
return p.connection == 0
|
||||
&& second_clock::local_time() - p.connected > seconds(30*60);
|
||||
&& second_clock::local_time() - p.connected > minutes(30);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@ namespace libtorrent
|
|||
#endif
|
||||
|
||||
std::string escape_string(const char* str, int len);
|
||||
std::string unescape_string(std::string const& s);
|
||||
|
||||
struct tracker_alert: alert
|
||||
{
|
||||
|
|
|
@ -180,6 +180,34 @@ namespace
|
|||
|
||||
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)
|
||||
{
|
||||
static const char special_chars[] = "$-_.+!*'(),";
|
||||
|
|
Loading…
Reference in New Issue