Mercurial > louis > mq > lightsd
changeset 45:7308696b3dcb
wip on gateway expiring, display time between last request and response
author | Louis Opter <kalessin@kalessin.fr> |
---|---|
date | Sun, 11 Jan 2015 11:21:46 +0100 |
parents | 195bc9826179 |
children | 15919c1ddad9 |
files | expire_unreachable_gateways.patch |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/expire_unreachable_gateways.patch Sat Jan 10 13:15:42 2015 -0800 +++ b/expire_unreachable_gateways.patch Sun Jan 11 11:21:46 2015 +0100 @@ -432,15 +432,19 @@ #include "lifxd.h" static struct { -@@ -155,6 +156,7 @@ +@@ -155,6 +156,11 @@ } if (gw) { void *pkt = &read.buf[LIFXD_PACKET_HEADER_SIZE]; + gw->lastresp_at_msecs = lifxd_time_monotonic_msecs(); ++ lifxd_debug( ++ "[%s]:%hu latency = %ld", ++ gw->lastresp_at_msecs - gw->lastreq_at_msecs ++ ); pkt_infos->decode(pkt); pkt_infos->handle(gw, &read.hdr, pkt); } else { -@@ -196,8 +198,8 @@ +@@ -196,8 +202,8 @@ sizeof(lifx_addr) ); if (nbytes == sizeof(get_pan_gateway)) { @@ -451,7 +455,7 @@ ); if (event_del(lifxd_broadcast_endpoint.write_ev) || event_add(lifxd_broadcast_endpoint.discovery_timeout_ev, &tv)) { -@@ -257,7 +259,7 @@ +@@ -257,7 +263,7 @@ lifxd_info( "discovery didn't returned anything in %dms, restarting it",