On 2014/06/24 20:36, Brian Callahan wrote:
> +$OpenBSD$
> +
> +Fix a time_t warning.
> +
> +--- src/ServerStat.cc.orig Mon Jun 23 23:59:36 2014
> ++++ src/ServerStat.cc Tue Jun 24 00:03:56 2014
> +@@ -205,7 +205,7 @@ bool ServerStat::operator==(const ServerStat& serverSt
> + std::string ServerStat::toString() const
> + {
> + return fmt("host=%s, protocol=%s, dl_speed=%d, sc_avg_speed=%d,"
> +- " mc_avg_speed=%d, last_updated=%ld, counter=%d, status=%s",
> ++ " mc_avg_speed=%d, last_updated=%lld, counter=%d, status=%s",
> + getHostname().c_str(),
> + getProtocol().c_str(),
> + getDownloadSpeed(),
Nearly, but you should also cast the parameter, so it can be fed
upstream (otherwise this patch will break on OS which have 32 bit time_t).
This ought to do:
return fmt("host=%s, protocol=%s, dl_speed=%d, sc_avg_speed=%d,"
" mc_avg_speed=%d, last_updated=%lld, counter=%d, status=%s",
getHostname().c_str(),
getProtocol().c_str(),
getDownloadSpeed(),
getSingleConnectionAvgSpeed(),
getMultiConnectionAvgSpeed(),
(long long)getLastUpdated().getTime(),
getCounter(),
STATUS_STRING[getStatus()]);