forked from premiere/premiere-libtorrent
build fixes
This commit is contained in:
parent
baa6ea74b8
commit
d157af5305
|
@ -812,7 +812,8 @@ namespace libtorrent
|
|||
void tracker_request_error(
|
||||
tracker_request const&
|
||||
, int response_code
|
||||
, const std::string& str)
|
||||
, const std::string& str
|
||||
, int retry_interval)
|
||||
{
|
||||
char msg[256];
|
||||
snprintf(msg, sizeof(msg), "*** tracker error: %d: %s", response_code, str.c_str());
|
||||
|
|
|
@ -537,7 +537,7 @@ namespace aux {
|
|||
if (getrlimit(RLIMIT_NOFILE, &rl) == 0)
|
||||
{
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING || defined TORRENT_ERROR_LOGGING
|
||||
(*m_logger) << time_now_string() << "max number of open files: " << rl.rlim_cur << "\n";
|
||||
(*m_logger) << time_now_string() << " max number of open files: " << rl.rlim_cur << "\n";
|
||||
#endif
|
||||
|
||||
// deduct some margin for epoll/kqueue, log files,
|
||||
|
|
25
src/time.cpp
25
src/time.cpp
|
@ -58,18 +58,31 @@ namespace libtorrent
|
|||
|
||||
char const* time_now_string()
|
||||
{
|
||||
time_t t = std::time(0);
|
||||
tm* timeinfo = std::localtime(&t);
|
||||
static char str[200];
|
||||
std::strftime(str, 200, "%b %d %X", timeinfo);
|
||||
return str;
|
||||
// time_t t = std::time(0);
|
||||
// tm* timeinfo = std::localtime(&t);
|
||||
// static char str[200];
|
||||
// std::strftime(str, 200, "%b %d %X", timeinfo);
|
||||
// return str;
|
||||
|
||||
static const ptime start = time_now_hires();
|
||||
static char ret[200];
|
||||
int t = total_milliseconds(time_now_hires() - start);
|
||||
int h = t / 1000 / 60 / 60;
|
||||
t -= h * 60 * 60 * 1000;
|
||||
int m = t / 1000 / 60;
|
||||
t -= m * 60 * 1000;
|
||||
int s = t / 1000;
|
||||
t -= s * 1000;
|
||||
int ms = t;
|
||||
snprintf(ret, sizeof(ret), "%02d:%02d:%02d.%03d", h, m, s, ms);
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string log_time()
|
||||
{
|
||||
static const ptime start = time_now_hires();
|
||||
char ret[200];
|
||||
std::sprintf(ret, "%d", total_milliseconds(time_now() - start));
|
||||
snprintf(ret, sizeof(ret), "%d", total_milliseconds(time_now_hires() - start));
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3148,7 +3148,7 @@ namespace libtorrent
|
|||
|
||||
#if defined TORRENT_VERBOSE_LOGGING || defined TORRENT_LOGGING
|
||||
(*m_ses.m_logger) << time_now_string() << " completed resolve proxy hostname for: " << web.url << "\n";
|
||||
if (ec)
|
||||
if (e)
|
||||
*m_ses.m_logger << time_now_string() << " on_proxy_name_lookup: " << e.message() << "\n";
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue