Avoid using labs() on time_t in channeltls.c
commit0849d2a2fdaeea2871f32bed35d410f19703aae1
authorNick Mathewson <nickm@torproject.org>
Tue, 6 Aug 2019 15:11:06 +0000 (6 11:11 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 6 Aug 2019 15:11:06 +0000 (6 11:11 -0400)
treeb41e92f65f462605ecf5dc5076f43e9c15561539
parentfb977f8cac99c008f11e054f07b8c4be5fc5a0c5
Avoid using labs() on time_t in channeltls.c

On some windows builds, time_t is 64 bits but long is not.  This is
causing appveyor builds to fail.

Also, one of our uses of labs() on time_t was logically incorrect:
it was telling us to accept NETINFO cells up to three minutes
_before_ the message they were responding to, which doesn't make
sense.

This patch adds a time_abs() function that we should eventually move
to intmath.h or something.  For now, though, it will make merges
easier to have it file-local in channeltls.c.

Fixes bug 31343; bugfix on 0.2.4.4-alpha.
changes/bug31343 [new file with mode: 0644]
src/or/channeltls.c