Fix: Connect timeout arithmetic in inet/inet6 (v4)
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 13 Nov 2018 17:12:20 +0000 (12:12 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 16 Nov 2018 22:15:50 +0000 (17:15 -0500)
commit2daf65025e0fe5c15179dc4bfb26f875e3d31a26
tree23917454c0c084bd99d5d96caca02f2df27e4d7c
parent9a6545985844978f34f88b82bf1bcd649968c0a3
Fix: Connect timeout arithmetic in inet/inet6 (v4)

The nanoseconds part of the timespec struct time_a is not always
bigger than time_b since it wraps around each second.

Use 64-bit arithmetic to compute the difference.

Merge/move duplicated code into utils.c.

This function is really doing two things. Split it into
timespec_to_ms() and timespec_abs_diff().

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/common.h
src/common/sessiond-comm/inet.c
src/common/sessiond-comm/inet6.c
src/common/time.h
src/common/utils.c
This page took 0.026828 seconds and 4 git commands to generate.