parent
73d546b23a
commit
48da60d883
|
@ -100,13 +100,16 @@ static void tip_client_error(struct tip_client *cli)
|
|||
tip_client_close(cli);
|
||||
}
|
||||
|
||||
/* display progress message every 30 seconds. */
|
||||
#define TIP_CLIENT_PROGRESS 30
|
||||
|
||||
static void tip_client_progress(struct tip_client *cli, bool now)
|
||||
{
|
||||
struct timeval tv_cur, tv;
|
||||
|
||||
gettimeofday(&tv_cur, NULL);
|
||||
timersub(&tv_cur, &cli->tv_last, &tv);
|
||||
if (now || tv.tv_sec >= 1) {
|
||||
if (now || tv.tv_sec >= TIP_CLIENT_PROGRESS) {
|
||||
timersub(&tv_cur, &cli->tv_start, &tv);
|
||||
printf("%3lu%% (%lu Mbytes/second) %s from %s:9999\n",
|
||||
cli->content_len > 0 ? 100 * cli->data_len / cli->content_len : 0,
|
||||
|
|
Loading…
Reference in New Issue