# HG changeset patch # User Thomas Klausner # Date 1368442685 -7200 # Node ID a325f95de6599f202e83293ea9b8d7560e630b19 # Parent b6885b0d8b10945409a673de88fb52c1ef5a2046 Set absolute timeout in second place. diff -r b6885b0d8b10 -r a325f95de659 extensions/rt_busypeers/rtbusy.c --- a/extensions/rt_busypeers/rtbusy.c Mon May 13 11:46:14 2013 +0200 +++ b/extensions/rt_busypeers/rtbusy.c Mon May 13 12:58:05 2013 +0200 @@ -106,8 +106,11 @@ } /* Send the query again. We need to re-associate the expirecb which was cleaned, if it is used */ if (rtbusy_conf.RelayTimeout) { - struct timespec tm = { .tv_sec = rtbusy_conf.RelayTimeout/1000, .tv_nsec=1000000LL * (rtbusy_conf.RelayTimeout % 1000) }; - CHECK_FCT( fd_msg_send_timeout( pmsg, NULL, NULL, rtbusy_expirecb, &tm ) ); + struct timespec expire; + CHECK_SYS( clock_gettime(CLOCK_REALTIME, &expire) ); + expire.tv_sec += rtbusy_conf.RelayTimeout/1000 + ((expire.tv_nsec + (1000000LL * (rtbusy_conf.RelayTimeout % 1000))) / 1000000000LL); + expire.tv_nsec = (expire.tv_nsec + (1000000LL * (rtbusy_conf.RelayTimeout % 1000))) % 1000000000LL; + CHECK_FCT( fd_msg_send_timeout( pmsg, NULL, NULL, rtbusy_expirecb, &expire ) ); } else { CHECK_FCT( fd_msg_send(pmsg, NULL, NULL) ); }