www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: Re: Timestamp patch for _libssh2_debug()

Re: Timestamp patch for _libssh2_debug()

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 4 Mar 2012 23:33:54 +0100 (CET)

On Wed, 29 Feb 2012, Tom Weber wrote:

> The timestamps generated by _libssh2_debug() measure time since a quite
> arbitrary point in time. It's the first time the function was called,
> rounded down to the previous whole second. So if gettimeofday() returned
> 1000000.123456 the first time, the time 1000000.000000 is taken as the
> reference. So if the next call occurs at gettimeofday() 1000000.456789,
> _libssh2_debug() would print 0.456789 as timestamp, instead of 0.333333
> which is the actual time difference. This caused some confusion as my
> application mixes these printouts with similar ones with proper calculation,
> so the time could seem to jump up and down by as much as a second in the
> logs.
> My patch saves also the second fraction at the first call, and makes a
> proper calculation using carry.


Can you please resubmit the patch made with diff -u instead or even directly
with git? That makes it much easier for us to apply and even to review the
change inlined.

  / daniel.haxx.se
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2012-03-04

the libssh2 team