Now make_ping_time() in common/util.c returns the time in milliseconds instead

of microseconds.
In fe_set_lag(serv, lag) the lag argument is now in milliseconds as well.

Fixes #758.
This commit is contained in:
Diogo Sousa
2014-01-27 20:24:56 +00:00
parent 1d6d737927
commit 9969282c72
5 changed files with 15 additions and 15 deletions

View File

@@ -892,8 +892,8 @@ inbound_ping_reply (session *sess, char *timestring, char *from,
if (lag)
{
sess->server->lag_sent = 0;
sess->server->lag = dif / 1000;
fe_set_lag (sess->server, dif / 100000);
sess->server->lag = dif;
fe_set_lag (sess->server, dif);
return;
}
@@ -906,7 +906,7 @@ inbound_ping_reply (session *sess, char *timestring, char *from,
tags_data->timestamp);
} else
{
snprintf (outbuf, sizeof (outbuf), "%ld.%ld%ld", dif / 1000000, (dif / 100000) % 10, dif % 10);
snprintf (outbuf, sizeof (outbuf), "%ld.%03ld", dif / 1000, dif % 1000);
EMIT_SIGNAL_TIMESTAMP (XP_TE_PINGREP, sess, from, outbuf, NULL, NULL, 0,
tags_data->timestamp);
}